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

Loop through nested grid (hierarchical)

2 Answers 271 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jean-Marc
Top achievements
Rank 1
Jean-Marc asked on 04 Aug 2011, 05:09 PM
It has to be simple, I apologize, can't find how to access in a tree way to nested table.
In the code below i have to relpace ??? with what?

For Each item As GridDataItem In RadGridResources.MasterTableView.Items
       idResource = item("IDResource").Text
 
      For Each childitem As ??? In ???
          idSlot = childitem("IDSlot").Text
      Next
 
  Next

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Aug 2011, 06:53 AM
Hello Jean,

You can access the child item as shown below.
VB:
Protected Sub RadGrid2_ItemDataBound(sender As Object, e As GridItemEventArgs)
    If TypeOf e.Item Is GridDataItem AndAlso e.Item.OwnerTableView.Name = "DetailTable1" Then
        Dim detailTable As GridTableView = DirectCast(e.Item.OwnerTableView, GridTableView)
        For Each childitem As GridDataItem In detailTable.Items
            Dim str As String = childitem("IDSlot").Text       
     Next
    End If
End Sub

Thanks,
Princy.
0
Jayesh Goyani
Top achievements
Rank 2
answered on 05 Aug 2011, 06:55 AM
Hello Jean-Marc ,

please check below link and let me know if any concern.

http://www.telerik.com/help/aspnet/grid/grdtraversingdetailtablesitemsingrid.html

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Jean-Marc
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jayesh Goyani
Top achievements
Rank 2
Share this question
or