ExpandCollapse column won't stay hidden

2 posts, 0 answers
  1. Adam
    Adam avatar
    177 posts
    Member since:
    Oct 2012

    Posted 13 Aug 2008 Link to this post

    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.
  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 18 Aug 2008 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top