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

Expand all sub-grids by default?

1 Answer 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 14 Jan 2009, 01:30 AM
Hi

I got a multiple levels RadGrid generated in run-time. I tried the following code, which can only expand the first level of sub grid by default.

RadGrid1.MasterTableView.HierarchyDefaultExpanded =

true;

 

 

foreach (GridTableView gtv in RadGrid1.MasterTableView.DetailTables)

 

    gtv.HierarchyDefaultExpanded =

true;

Just wonder how to expand all sub-grids at one time by default.

Thanks in advance,
Richard

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Jan 2009, 04:11 AM
Hi Richard,

Try the following code snippet to expand the entire Grid.

CS:
  RadGrid1.MasterTableView.HierarchyDefaultExpanded = true
        for (int i = 1; i <= RadGrid1.MasterTableView.DetailTables.Count; i++) 
        { 
            RadGrid1.MasterTableView.DetailTables[i-1].HierarchyDefaultExpanded = true
        } 
        RadGrid1.MasterTableView.Rebind(); 



Thanks
Shinu
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or