Dynamically showing fields to a Dev Express Grid view on windows form
- by Bhaskar
In one of windows application in C# , I am using Dev Express Grid view control to bind some data and display it to user. I have custom business objects with properties defined for this purpose.Then I simple set the DataSource of the grid to the list of my custom business objects.
A while ago , there came a requirement which means that the columns to be displayed on to the grid will be dynamic. This means I cannot know at design time which fields I will need to display.
I was thinking of abandoning setting the DataSource and populating the grid manually by code. But I think this will cause many of the grid's features not to work properly, for example , grouping the data by drag n drop of fields to the header area etc. Is there any way to tell a grid at runtime to skip certain fields from a list of BO's when databinding to the grid ?