Hello,
In my application I met an issue with derived interface. Fortunately I can reproduce it in simple solution, so I am attaching it.
If you run attached example, you will see DataGrid with single column: Favourite Shop. That's one of IWoman properties. But IWoman contains also properties derived from IPerson: FirstName, SecondName, Comments. My question is why GridControl doesn't see them?
In my application I tried to prepare the columns in designer, but it didn't help. The columns remained empty.
The only workaround I found was to use BindingList<Women> instead of BindingList<IWoman> . But that's not nice solution, I need an interface.
Can you please look at it? It sounds to me like DevExpress bug: GridControl doesn't see properties defined by parent interface.
Note1: I tried also 13.1 version, the bug is still there.
Note2: The problem is not visible on all machines. Some machines show all 4 columns, some of them show only 1 column.
GridControl hides columns defined by parent interface
Answers approved by DevExpress Support
Hi Robert,
Our Grid uses the same way to obtain columns as the standard DataGridView. It gets the type of the list indexer property (the type by which a list is typed) and uses the standard TypeDescriptor.GetProperties method to get properties of the obtained type. In your case, the IWoman interface is a type of the list indexer property and that type has only one FavouriteShop property. Thus, the Grid can obtain only this very property. If you replace our Grid with the standard DataGridView, you will see the same behavior.
To resolve the issue, you can implement your own list that implements the ITypedList interface and return in the ITypedList.GetItemProperties method a collection of desired properties.
Another approach is to use unbound columns.