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


in 1 of windows application in c# , using dev express grid view control bind data , display user. have custom business objects properties defined purpose.then simple set datasource of grid list of custom business objects.

a while ago , there came requirement means columns displayed on grid dynamic. means cannot know @ design time fields need display.

i thinking of abandoning setting datasource , populating grid manually code. think cause many of grid's features not work properly, example , grouping data drag n drop of fields header area etc. there way tell grid @ runtime skip fields list of bo's when databinding grid ?

this pretty simple, time. need bind grid datasource , rest you.

hiding fields easy also, set visibleindex -1

you this

c#

grid.focusedview.columns["col1"].visibleindex = -1; 

vb

grid.focusedview.columns("col1").visibleindex = -1; 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -