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

Reference a RadGrid inside a FormTemplate of another RadGrid

3 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeff H.
Top achievements
Rank 1
Jeff H. asked on 10 Jul 2013, 12:05 AM
I am new to Rad Controls and have a question.  I have a FormTemplate on a RadGrid for editing/Inserting data. I would also like to include a couple of RadGrids inside of the FormTemplate.  I will manually load them using methods in the code behind file.  However, I am not sure how I can reference the "SubGrids".  The designer.vb files do not reference the "SubGrids" and if I try to add reference to the designer.vb file I am still not able to reference them in the code behind file.

Thanks in Advance...

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 10 Jul 2013, 05:15 AM
Hi Jeff,

Please try the following code snippet to access the radgrid inside the editform.

VB:
Protected Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs)
    If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
        Dim edit As GridEditableItem = DirectCast(e.Item, GridEditableItem)
            'Access the sub-radgrid    
        Dim subgrid As RadGrid = DirectCast(edit.FindControl("SubGridID"), RadGrid)
    End If
End Sub

Hope this helps.

Thanks,
Princy
0
Jeff H.
Top achievements
Rank 1
answered on 10 Jul 2013, 06:09 AM
It worked GREAT.

Thank you Very Much,

Jeff
0
Jeff H.
Top achievements
Rank 1
answered on 10 Jul 2013, 06:11 AM
It worked GREAT...

Thank You,  Jeff
Tags
Grid
Asked by
Jeff H.
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jeff H.
Top achievements
Rank 1
Share this question
or