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,
1 Answer, 1 is accepted
answered on 05 Dec 2012, 07:41 AM
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.
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.