Trying to bind multiple GridViews inside RadPanelBar

3 posts, 0 answers
  1. Laurie
    Laurie avatar
    141 posts
    Member since:
    Feb 2007

    Posted 11 May 2009 Link to this post

    I'm trying to bind a gridview inside a RadPanelBar.  My initial aspx code is somewhat like this:


    <telerik:RadPanelBar ID="rpbSections" runat="server">





    <telerik:RadPanelItem runat="server">




    <telerik:RadPanelItem runat="server">




    <asp:GridView ID="gvPlanContents" runat="server" AutoGenerateColumns="True"


    DataKeyNames="PlanContentID" HorizontalAlign="Center" Width="60%" ShowHeader="true"


    EmptyDataText="No Data here">















    My code starts something like this:


    List<PlanSections> mySections = PlanSections.GetAllPlanSections();
    rpbSections.DataSource = mySections;



    rpbSections.DataValueField =




    rpbSections.DataTextField =







    for (int i = 0; i < rpbSections.Controls.Count; i++)






        int mySectionID = Convert.ToInt32(rpbSections.Items[i].Value);



       // what I need to know is, what code do I use to access the gridview.  I want to bind it for each
        // of its instantiations, by generating an object that depends on the value of MySectionID.
        // Where do I go from here?






  2. Paul
    Paul avatar
    4281 posts

    Posted 12 May 2009 Link to this post

    Hello Laurie,

    The FindControl method provides you with a reference to any control inside any of the templates used in the RadPanelBar or any of its PanelItems. You have to make sure that you properly typecast the returned value as FindControl returns a reference to a Control class.

    For details on the matter please refer to this example.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Telerik UI for ASP.NET Core is out
  4. Laurie
    Laurie avatar
    141 posts
    Member since:
    Feb 2007

    Posted 04 Nov 2009 Link to this post

    I'm moving this into a support ticket.  Will update once it's resolved.
Back to Top