I have been debugging this for a day and I am getting nowhere. Hoping I can get some info on how the viewstate for the Grid should work.
I have a CompositeControl that has a RadGrid added to the Child Controls in teh CreateChildControls override. I set a number of properties, wire up some events, and then add some columns manually to teh MasterTableView column Collection. On teh initial load of the page the colums are there as they should be. Not every postback to the page will populate the grid. But with every postback, I get extra columns in my grid. If I add 2 colums to my grid manually in CreateChildControls, that is how many are added to the grid as extras with each postback.
I have stepped through the code (we have Telerik source) and the extra columns are being added in teh Load ViewState.
What am I doing wrong? Should I not be re-adding my columns to the Column Collection if it is a Post Back? What if my Post Back causes the columsn that are in teh grid to change? I should be able to create a whole different set of columns on post back. Then I wouldn't want viewstate, but if the columns stayed the same, I do.
Also, once my grid is databound to an object datasource and displays data, the data is correct for my original 2 columns, but not for the extras added from viewstate.
I have a CompositeControl that has a RadGrid added to the Child Controls in teh CreateChildControls override. I set a number of properties, wire up some events, and then add some columns manually to teh MasterTableView column Collection. On teh initial load of the page the colums are there as they should be. Not every postback to the page will populate the grid. But with every postback, I get extra columns in my grid. If I add 2 colums to my grid manually in CreateChildControls, that is how many are added to the grid as extras with each postback.
I have stepped through the code (we have Telerik source) and the extra columns are being added in teh Load ViewState.
What am I doing wrong? Should I not be re-adding my columns to the Column Collection if it is a Post Back? What if my Post Back causes the columsn that are in teh grid to change? I should be able to create a whole different set of columns on post back. Then I wouldn't want viewstate, but if the columns stayed the same, I do.
Also, once my grid is databound to an object datasource and displays data, the data is correct for my original 2 columns, but not for the extras added from viewstate.