This is a migrated thread and some comments may be shown as answers.

[Solved] "Expand All Button for 2-level Hierarchy Grid

1 Answer 207 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 23 Apr 2009, 01:14 AM
Hello,

We have a 2 level Hierarchy grid. Like this but 2 levels http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/declarativerelations/defaultcs.aspx

By default, the top level grid is collapsed and you have to click the little expand button on the left to show the sub-grid for each row. We want to use a telerik Toolbar above the grid and have an "Expand all" link so the user can click and expand all the rows to show the level 2 grids--thus expanding all the grids to show sub-grids.

Sample code? Thanks guys!

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 23 Apr 2009, 04:55 AM
Hi Brett,

Try out the following code snippet for expanding the item on ToolBar_ButtonClick event.

CS:
 
protected void RadToolBar1_ButtonClick(object sender, RadToolBarEventArgs e) 
    foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
    { 
        item.Expanded = true
    } 

Thnaks,
Shinu.
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or