Dealing with Dependcy Properties/Columns in GridControl?
I am working with a DevExpress GridView and have an object I'm trying to populate in the grid. E.G lets say I have a Product.
My first column is a RepositoryEditorLookupEdit which contains a list of products. What I want is that if a specific product is selected like Coke, I want some columns to be populated with the product's other properties, such as Color, Price, Description etc... Tricky bit is that the GridControl is bound to object type 'TransactionItem' which has a relationship to Product {Many-to-Many} and of cause have a interreship 'TransactionProduct'. I have tried using unbound columns but the Grid loses the values after RowChange. Is there a way to overcome this or is my design wrong. Basically, I want my columns to populate based on the object selected in开发者_Go百科 another column.Do you want to initialize some column with default values? If so, you should handle the GridView's CellValueChanged event and update other cell values in this row using the
GridView.SetRowCellValue(gridView.FocusedRowHandle, gridView.Columns["Price"], somePrice);
method. Also, if you are using an unbound column, you should preserve its new data using the CustomUnboundColumnData event handler.
精彩评论