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

Finding RadGrid inside of PageView

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 25 Oct 2011, 10:02 PM
Setup:  (this is based on one of Telerik's example scenarios)
  • One RadTabStrip with 3 tabs
  • Each tab has a single PageView
  • Each PageView is dynamically loaded with a UserControl
  • Each UserControl contains a RadGrid
  • Each RadGrid contains a "clientselectcolumn" and allows client-side row selection

Scenario:
  • Select a row in grid on Tab1
  • Select Tab2
  • Select Tab1


Problem:
  • If I were performing this operation server-side I would use code similar to the following to find the grid:
    RadGrid rg = RadTabStrip1.SelectedTab.PageView.Controls[0].FindControl("RadGrid1")
  • Client-side, I have been able to obtain the PageView via the onTabSelected event:
    args.get_tab().get_pageView().  Unfortunately, there isn't a "findControl" method so I cannot find "RadGrid1".

Question:
  • How do I find the grid on Tab1 via client-side code?

1 Answer, 1 is accepted

Sort by
0
Terry
Top achievements
Rank 1
answered on 25 Oct 2011, 11:15 PM
Although I came up with the following code that works...is it the "best" way to find the grid?

function onTabSelected(sender, args) {
  if (args.get_tab().get_pageViewID()) {
    var ucname = args.get_tab().get_value() + "_userControl_RadGrid1";
    var grid = $find(ucname);
    RowProcessor(grid);
  }
}
Tags
Grid
Asked by
Terry
Top achievements
Rank 1
Answers by
Terry
Top achievements
Rank 1
Share this question
or