Hidden columns visible on post back

2 posts, 0 answers
  1. AHM
    AHM avatar
    2 posts
    Member since:
    Jan 2011

    Posted 30 Nov 2012 Link to this post


    I am hiding a number of columns, TreeListSelectColumn and TreeListButtonColumn on ItemDatabound. When the page does a postback or async postback the columns reappear?

    Any suggestions much appreciated,

  2. Radoslav
    Radoslav avatar
    1564 posts

    Posted 05 Dec 2012 Link to this post

    Hi Ross,

    The ItemDataBound event is fired only when the control is rebound, however when the control is not rebound on postback the event is not fired and all cells’ values are populated from the ViewState. So if you hide some columns on ItemDataBound and then perform postback without rebinding the control the columns will be visible, because the code into ItemDataBound event will not be executed. To achieve the desired functionality you could try hiding the columns on ItemCreated event. Please give it try and let me know if it helps you.

    Looking forward for your reply.

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top