I have ColumnGrouping enabled on a WebHierarchicalGridView that is databound to a DataSet containing a single DataTable. When I dropped a column into the group area, I get a nice breadcrumb-like display of my grouped columns. It appears to be the Grid name and then a list of the grouped columns. For mine, it initially said "Table1 > ColumnName". I've attached a screenshot of the column grouping area I'm talking about.
I want to be able to change the "Table1" text, so I figured I could set the TableName of the DataTable I used to bind the WebHierarchicalDataGrid. And it worked! If I set DataTable.TableName = "NameOfGrid", I'd see the text changed to "NameOfGrid > ColumnName".
However, I need to change the datasource on demand. So in code-behind I do a bunch to clear out the grid's state (GridView.ClearDataSource(), DataSource = null/DataBind(), GroupedRows.Clear(), GroupedColumns.Clear(), etc) and regenerate a new DataTable, set its TableName to something new, and rebind. But when I group columns again, the old TableName is still shown in the grouped column area.
How do I clear/change the text used in this part of the grid? It appears to be initially set from my DataTable.TableName property, but once set, it's never changed, no matter what I do with the underlying dataset.
Again, I've attached a screenshot of what I'm talking about. Any insight is greatly appreciated!!
HI kfiduk,
Could you try to set the Key of the WebHierarchicalDataGrid? That is what is showing. it is the key of the Band.
regards,
David Young
David,
You are both "the man" and "my hero". Thanks!!
Kenneth