Hai all, Am using devexpress XtraGrid in C#.NET application.On run time i want to hide 1 column of XtraGrid and access that column in code behind page.And please help to access rows and columns of XtraGrid.
Thank You
To hide a column from user set columns visible property to False as mentioned above.
However this puts the hidden column in SelectColumn Menu which user can access at run time.
Right Click Grid Header -> Click Select Columns -> Choose hidden column from small window -> Drag it to the Grid.
In this case your hidden columns will be available to user. There are two possible solutions to avoid above Situation:
In Addition to setting visible property of Column also set OptionColumn.AllowShowHide to False. This will make sure that this column will not Pop up in column select window.
Other solution should be used only when you want to give absolutely no right to the user for changing the layout of the grid. This can be done by Setting GridView's property - OptionMenu->EnableColumnMenu to False. However after setting this user will be restricted from all other layout Options also like Groupping, filter, search etc.
You should use the View.Columns[someFieldName].Visible property to hide / show a column. Please also refer to the following topic:
http://documentation.devexpress.com/#WindowsForms/CustomDocument753
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With