This is a migrated thread and some comments may be shown as answers.
Find RadGrid control in TabStrip/Multipage
4 Answers 107 Views
This is a migrated thread and some comments may be shown as answers.
Jeff Reinhardt
Top achievements
Rank 1
Jeff Reinhardt asked on 21 Oct 2010, 02:20 PM
Ok,  I have an aspx page with a tabstrip and multipage in it.  There are 3 tabs,  on the second tab there is a radgrid (rgManage).  When this tab is clicked I need to refresh the grid.

protected void radtabCallInOrder_Click(object sender, RadTabStripEventArgs e)
{
      if (e.Tab.Text == "Order Items")
      {
         RadGrid rgManage = (RadGrid)Page.Master.FindControl("ContentPlaceHolder1").FindControl("radmultipageCallInOrder").FindControl("rgManage");
  
         if (rgManage != null)
         {
             rgManage.Rebind();
         }
      }
   
  }

I can find the multipage control, but how do I find the radgrid which is in the PageView of the multipage?  The above does not work but it is where I am at.

4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 22 Oct 2010, 08:14 AM
Hello Jeff,

Actually RadPageView is just a container, so you can access the controls placed in it directly with their ID (you don't need to use FindControl method for the multipage and the pageview).

All the best,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jeff Reinhardt
Top achievements
Rank 1
answered on 22 Oct 2010, 02:47 PM
Then how would I address that control without a FindControl?

The pageview loads a user control (ascx) page that has the radgrid on it.  How would I address it without a FindControl?
0
Cori
Top achievements
Rank 2
answered on 22 Oct 2010, 06:08 PM
You would have to search for it inside of the UserControl, if that's where it is. From what I'm seeing, you trying to find the control from inside the RadMultiPage, where it doesn't exist.

It would have to be something like: [UserControl].FindControl("rgManage");

I hope that helps.
0
Brad H
Top achievements
Rank 2
answered on 21 Jan 2011, 01:53 AM
This helped me a lot!  Thanks for the advice.  I have a tabstrip with a multipage with grids each in their own usercontrol.  Here's how I did it:

Protected Sub tabstrip_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles tabstrip.TabClick
        Dim grid As RadGrid
        Select e.Tab.Text
            Case "Tab 1"
                grid = uc1.FindControl("rg1")
                grid.Rebind()
            Case "Tab 2"
                grid = uc2.FindControl("rg2")
                grid.Rebind()
            Case "Tab 3"
                grid = uc3.FindControl("rg3")
                grid.Rebind()
            Case "Tab 4"
                grid = uc4.FindControl("rg4")
                grid.Rebind()
        End Select
    End Sub
Asked by
Jeff Reinhardt
Top achievements
Rank 1
Answers by
Yana
Telerik team
Jeff Reinhardt
Top achievements
Rank 1
Cori
Top achievements
Rank 2
Brad H
Top achievements
Rank 2
Share this question
or