I am using Hierarchy grid view
what i need is how can expand or collapse all childtemplates in the Hierarchy grid view
And also suggest me how to know all the features of Hierarchy grid view (can i display total number of records on top of each childtemplate...)
1 Answer, 1 is accepted
0
Jack
Telerik team
answered on 20 May 2009, 01:00 PM
Hello Praveen Kumar ,
You can expand all child views by iterating over all parent rows and setting the IsExpanded property to true. You should call the BeginUpdate and EndUpdate methods to avoid unnecessary updates. Please take a look at the code snippet below:
radGridView1.GridElement.BeginUpdate();
foreach (GridViewDataRowInfo row in radGridView1.Rows)
{
row.IsExpanded = true;
}
radGridView1.GridElement.EndUpdate();
You should use a custom cell to show the number of records available in the child view. To do this, create a new cell element that inherits from GridDataCellElement and handle its SetContentCore method. You should also handle CreateCell event and to add an unbound textbox column to your grid. Here is the code:
this.radGridView1.CreateCell += new GridViewCreateCellEventHandler(radGridView1_CreateCell);