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

how reach all nodes in hierarchy radgrid?

2 Answers 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
samaneh
Top achievements
Rank 1
samaneh asked on 07 Mar 2011, 05:37 AM
hi all
I have 3level RadGrid Hierarchy.
in btn_save that is in out side of my radgrid,I want reach all rows in Hierarchy radgrid(from first level to last level)
how can I do that?

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 07 Mar 2011, 07:22 AM
Hello Samaneh,

Try the following code snippet to loops through each item in hierarchy.

C#:
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)//loops through each materTable rows
       {
           GridTableView childtableView = (GridTableView)item.ChildItem.NestedTableViews[0];
           foreach (GridDataItem childItem in childtableView.Items)//loos through each item in 2nd level hierarchy
           {
               GridTableView grandChildtableView = (GridTableView)childItem.ChildItem.NestedTableViews[0];
               foreach (GridDataItem grandChild in grandChildtableView.Items)//loos through each item in 3rd level hierarchy
               {
               }
           }
        }

Thanks,
Princy.
0
samaneh
Top achievements
Rank 1
answered on 07 Mar 2011, 07:44 AM
Thank you Princy.It works
Tags
Grid
Asked by
samaneh
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
samaneh
Top achievements
Rank 1
Share this question
or