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

how can get nestedviewtemplate values

3 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dhamodharan
Top achievements
Rank 1
Dhamodharan asked on 29 Nov 2010, 08:35 AM
hi,

Find the attached grid image

I am using nestedviewtemplate in my application. i am saving the grid values using this query
 gvAddPlans - This original grid
gvAddSubPlans - This is nestedview grid

For Each item As GridDataItem In gvAddPlans.Items
 Next

How to get NestedView grid values.

i used this query

For Each NesItem As GridNestedViewItem In gvAddPlans.Items
Next

but it is not working
please give me any idea for this one.

Thanks,

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Nov 2010, 10:30 AM
Hello Dhamodharan,

The following code snippet shows how to loop thorough each NestedViweItem and items inside nested grid.
C#:
foreach (GridNestedViewItem item in grdAddPlans.MasterTableView.GetItems(GridItemType.NestedView)) // loop through the nested items of a NestedView Template
       {
           RadGrid grid = (RadGrid)item.FindControl("grdAddSubPlans");
           foreach(GridDataItem childitem in grid.Items)
           {
               // you can access NestedGrid items values
           }
       }

Thanks,
Princy.
0
Kiran
Top achievements
Rank 1
answered on 31 Dec 2019, 01:51 PM

This is not working in my case:

rgOnHands Main Grid

rgOnHands_Nested is the Nested Radgrid.

Trying to loop through Nested Radgrid in the Main grid ItemCommand.

For Each item As GridNestedViewItem In rgOnHands.MasterTableView.GetItems(GridItemType.NestedView)
                Dim grid As RadGrid = CType(item.FindControl("rgOnHands_Nested"), RadGrid)
                For Each childitem As GridDataItem In grid.MasterTableView.Items
                    MsgBox("KV")
                    strSid = childitem.GetDataKeyValue("SID")
                Next
            Next

 

Thank you.

0
Eyup
Telerik team
answered on 03 Jan 2020, 04:19 AM

Hello Kiran,

 

I've replied to your query in the following thread:
https://www.telerik.com/forums/nested-view-get-datakey-of-expanded-parent-grid-row

I suggest that we continue our technical discussion on the mentioned thread.

 

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Dhamodharan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kiran
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or