Telerik访问RadListView内的Radgrid

时间:2017-04-07 09:37:01

标签: vb.net telerik radgrid radlistview

我有一个嵌套在radlistview中的radgrid。有人知道如何通过点击按钮来引用radgrid吗?我目前正在循环遍历radlistview,我想循环遍历该循环中的radgrid。

For Each item As RadListViewDataItem In RadListView1.Items

 'I AM SAVING RADLISTVIEW ITEMS HERE

            'THIS IS THE POINT WHERE I NEED TO ACCESS RADGRID1 
            'WHICH I DON'T KNOW HOW TO DO

            For Each item As GridDataItem In Radgrid1.MasterTableView.Items

             'I WILL BE SAVING RADGRID ITEMS HERE

            Next

Next

1 个答案:

答案 0 :(得分:0)

经过多年的捣乱,我在发布问题后两分钟发现了如何做我想做的事情。基本上我使用FindControl获取我的radgrid然后我可以像往常一样循环。不知道为什么我之前没有想到这一点。

Dim gvHours As RadGrid = DirectCast(item.FindControl("gvHours"), RadGrid)

For Each item As GridDataItem In gvHours.MasterTableView.Items

    'DO STUFF HERE

Next