I have classes such as Address & Client which hold properties.
I have created a ViewModel like so:
public class MyViewModel{
public Address MyAddressObj {get;set;}
public Client MyClientObj {get;set;}
}
Can I bind MyViewModel to the Grid and show the properties of the Address & Client classes. I have already tried and it just creates columns called MyAddressOb & MyClientObj. I would like to specify what properties of the classes are displayed in the grid if possible via code.
If you want to hide columns in the grid, the best thing to do is to handle the InitializeLayout event and set the hidden property on the columns.
Another option would be to apply the Browsable(false) attribute the properties that you want to hide from DataBinding.
That doesn't really answer the question I have a class which exposes 2 other classes as properties. When I bind to the grid it shows those class properties as 2 columns.
How do I specify the columns I want to appear from the properties of the 2 classes I have in the class I am binding to?