Dynamically showing fields to a Dev Express Grid view on windows form

Posted by Bhaskar on Stack Overflow See other posts from Stack Overflow or by Bhaskar
Published on 2010-04-27T17:09:24Z Indexed on 2010/04/28 9:23 UTC
Read the original article Hit count: 294

Filed under:
|

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 ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms