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

[Solved] Hierarichal RadGrid

1 Answer 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DK
Top achievements
Rank 2
DK asked on 22 Jul 2009, 01:28 PM
iHi
I Have a  hierarchical grid.

I have data in the hierarchical grid.
I have added some itemtemplates.

Now problem is that i am not able to fetch data from the detail table and masterdetail table from a button which is the outside of the grid.

I want to access the   hierarichal grid  data from a buton click which is outside the grid.

Please help me ASAP

Thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Jul 2009, 02:29 PM
Hello,

You can try out the following code inside a button click to access the detail table data inside a hierarchical grid :
c#:
 foreach (GridDataItem dataItem in RadGrid1.MasterTableView.Items) 
        { 
            if (dataItem.OwnerTableView.Name == "Master"
            { 
                string strtxt1 = dataItem["ProductID"].Text; 
                if (dataItem.Expanded) 
                { 
                    GridTableView nestedView = (GridTableView)dataItem.ChildItem.NestedTableViews[0]; 
                    foreach (GridDataItem item in nestedView.Items) 
                    { 
                        string strtxt2 = item["OrderID"].Text; 
                    } 
                }                
            } 
        } 

Thanks
Princy.
Tags
Grid
Asked by
DK
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or