Hello. I am trying to build a custom grid (extended from the RadGrid) dynamically at run-time, and the grid makes use of some custom column types that i have defined in a class file. As an added complication, the grid is housed in a user control.
I am having trouble getting the SortCommand to fire. It is my understanding that for the SortCommand to fire, the structure of the grid (i.e. the columns) needs to be created in the Init event of the grid. It is also my understanding, that because I am using custom column types, the MasterTableView's "EnableColumnViewState" property needs to be set to false.
The problem I'm having is that the structure of the grid changes depending on what the user chooses to do. In my case, I have a TreeView control with nodes, and each node causes a different DataTable to be generated, and the columns change from one table to the next.
So... until the user actually clicks a node to tell the application what data they want to view, I can't figure out how to set up the grid in the Init event since the Click event won't fire until after the Init event. So for now, I build the grid structure and bind in the click event, which works for displaying the data, but because it has happened too late in the event chain, ViewState isn't properly handled and the SortCommand event never fires when a user clicks on a column header.
I would appreciate any suggestions on how to set this up properly. Thanks.
I am having trouble getting the SortCommand to fire. It is my understanding that for the SortCommand to fire, the structure of the grid (i.e. the columns) needs to be created in the Init event of the grid. It is also my understanding, that because I am using custom column types, the MasterTableView's "EnableColumnViewState" property needs to be set to false.
The problem I'm having is that the structure of the grid changes depending on what the user chooses to do. In my case, I have a TreeView control with nodes, and each node causes a different DataTable to be generated, and the columns change from one table to the next.
So... until the user actually clicks a node to tell the application what data they want to view, I can't figure out how to set up the grid in the Init event since the Click event won't fire until after the Init event. So for now, I build the grid structure and bind in the click event, which works for displaying the data, but because it has happened too late in the event chain, ViewState isn't properly handled and the SortCommand event never fires when a user clicks on a column header.
I would appreciate any suggestions on how to set this up properly. Thanks.