Hi, could somebody please check my code and show me what is wrong?
Hello,
Thank you for contacting us and for the provided sample.
In the future could I ask you to be more specific with your question, this will help us to save time and efforts to find and investigate the issue. This will be highly appreciated.
Now about it, I have noticed that you are using the Columns collection without referring it from GridView. My suggestion is to add GridView and now on rebind the ViewState error will not be thrown.
You can find the modified sample attached to my reply.
Code snippet:
this.WebHierarchicalDataGrid1.GridView.Columns.Add(col2);
.....
this.WebHierarchicalDataGrid1.GridView.Columns.Clear();
....
this.WebHierarchicalDataGrid1.DataKeyFields = this.WebHierarchicalDataGrid1.GridView.Columns["UniqueID"].Key;
...
Thank you, but if I do so the grouping header text is wrong (see "How to change the group area text? " in the Froum). Is there any other possibility or must I wait for an update? BR
We can workaround this with a simple javascript implementation. The only thing that we need to do is to handle GroupedColumnChanged client event and there to loop through the grouped columns and change the content:
You can find the modified sample also attached.
Works perfect! Thanks a lot. From my site we could close this post. BR