This is a migrated thread and some comments may be shown as answers.

ExpandCollapse column won't stay hidden

1 Answer 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 13 Aug 2008, 03:20 PM
I have a grid that I'm binding different bits of data to it depending on what a user selects from a drop down list. The grid is a simple hierarchy grid (although sometimes it only has one level) with a check box column and a bound column. When the grid doesn't have hierarchical data, I want to hide the ExpandCollapsColumn which I'm doing in the code behind with this line every time a user changes their drop down selection:

grdList.MasterTableView.ExpandCollapseColumn.Display = False

However, when I page in the grid, the ExpandCollapseColumn comes back when it shouldn't. Sometimes I'm choosing to make the column appear if the data being bound to the grid supports it. So I don't want it to be permanently hidden. Is there a reason that the grid doesn't want to stay hidden after seeing Display = False? It seems like a bug, but I suppose there could be a reason for it.

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 18 Aug 2008, 11:38 AM
Hi Adam,

To make sure that the column stays hidden, you can locate the code to hide it in the PreRender event handler. Then, you can iterate through all the columns in the control (RadGrid1.MasterTableView.Columns) and when your iteration reaches the ExpandCollapse column, you can hide it. This should keep the column hidden.
Let me know how this helps.

Best wishes,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Adam
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or