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

[Solved] Loop on DetailTable

3 Answers 410 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jo
Top achievements
Rank 1
jo asked on 01 May 2009, 06:04 PM

foreach

 

(GridDataItem item in Radgrid1.MasterTableView.Items)

 

 {
    foreach (GridColumn col in Radgrid1.MasterTableView.RenderColumns)

 

    {

 

    }
}
This will loop through all the items in the MasterTable. Waht's the solution for DetailTable.
I have one detail table and I want to loop through this detail table.

Thanks.
Jo.

 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 May 2009, 04:10 AM
Hi,

Try with the following approach to loop through the detail table cells.

CS:
 
foreach(GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            if (item.Expanded) 
            { 
                GridTableView childTable = (GridTableView)item.ChildItem.OwnerTableView; 
 
                foreach (GridDataItem childItem in childTable.Items) 
                {  
                 
                } 
            } 
        } 


Shinu



0
jo
Top achievements
Rank 1
answered on 08 May 2009, 04:41 PM
thanks! that works..
0
Princy
Top achievements
Rank 2
answered on 11 May 2009, 08:01 AM
Hello Jo,

You can also have a look at the following help article which explains how to access detail tables through NestedTableViews collection.
Traversing detail tables/items in Telerik RadGrid

Princy.

Tags
Grid
Asked by
jo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
jo
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or