The demo shows how the hierarchical structure of Telerik RadGrid can be described and used
programmatically.
The
RadGrid.MasterTableView represents the top-level table in the hierarchy while each
GridTableView control is used to render inner table in the hierarchical structure.
Grouping by some of the grid columns is enabled along with the hierarchical look and feel. I
addition, we configured various appearance properties for better end user experience.
This example shows how to create the control entirely in the code behind. This means that the grid instance should be created in the
PageInit
handler and added to a place holder's Controls collection at runtime, after the structure has been created. Note that in this case
the grid columns should be added to the Controls collection of the MasterTableView
after their attributes are set.
No ViewState is required for grid structure to be persisted as it is recreated on each page initialization.
Note that hierarchical structure/grouping is not supported with simple data-binding
(calling DataBind()). See the
Simple data binding demo from the
Populating with
data section for more info about the limitations of this binding mode.
More about the conventions about how to generate Telerik RadGrid structure programmatically
you can find in the online documentation:
Creating hierarchical grid programmatically