Using RadPageView content url page how to get RadMultiPage

3 posts, 0 answers
  1. Raja
    Raja avatar
    8 posts
    Member since:
    Sep 2012

    Posted 06 Feb 2014 Link to this post

    In mainpage.aspx having radcombobox and TabStrip, radmutipage and radpageview.
    In radpageview content url page (page1.aspx) how to get the mainpage.aspx radcombobox. And if radcombobox onselecteditemchanged event i need to refresh the selected tab content url page(page1.aspx). 

    <telerik:RadComboBox ID="rcb1" runat="server" OnSelectedIndexChanged="rcb1_SelectedIndexChanged">
    </telerik:RadComboBox>
    <telerik:RadTabStrip ID="radtab1" runat="server" SelectedIndex="0" MultiPageID="radmulti1">
        <Tabs>
               <telerik:RadTab runat="server" Text="Discipline" PageViewID="pageview1"></telerik:RadTab>
                <telerik:RadTab runat="server" Text="Sub-Discipline" PageViewID="pageview1"></telerik:RadTab>
         </Tabs>
     </telerik:RadTabStrip>
     <telerik:RadMultiPage ID="radmulti1" runat="server" SelectedIndex="0" Width="400">
         <telerik:RadPageView ID="pageview1" runat="server" ContentUrl="Page1.aspx">
          </telerik:RadPageView>
          <telerik:RadPageView ID="pageview2" runat="server" ContentUrl="Page2.aspx">
          </telerik:RadPageView>
      </telerik:RadMultiPage>
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Feb 2014 in reply to Raja Link to this post

    Hi Raja,

    with reference to this form thread it is not possible to access the mainpage.aspx RadComboBox in the Page1.aspx. There is no relation between the mainpage.aspx and pages in the ContentUrl. As for your second question  the Page1.aspx will get refresh whenever a postback happens. Please take a look into the sample code snippet.

    ASPX:
    <telerik:RadComboBox ID="rcb1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="rcb1_SelectedIndexChanged">
    </telerik:RadComboBox>
    <telerik:RadTabStrip ID="radtab1" runat="server" MultiPageID="radmulti1" SelectedIndex="0">
        <Tabs>
            <telerik:RadTab runat="server" Text="Discipline" PageViewID="pageview1" Selected="True">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="radmulti1" runat="server" Width="400" SelectedIndex="0">
        <telerik:RadPageView ID="pageview1" runat="server" ContentUrl="Page1.aspx">
        </telerik:RadPageView>
    </telerik:RadMultiPage>

    Page1.ASPX:
    <asp:TextBox ID="textBox1" runat="server" Text="Demo">
    </asp:TextBox>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dave
    Dave avatar
    19 posts
    Member since:
    Nov 2010

    Posted 18 Feb 2014 in reply to Raja Link to this post

    Actually, the reply given by Shinu; "it is not possible to access the mainpage.aspx RadComboBox in the Page1.aspx" is not entirely true.  I had a need for that and accomplished it as follows:

    public partial class Default : System.Web.UI.Page
    {
        // declare a static variable that will point to this page (set in Page_Load())
        public static Page thisPage = null;
     
        protected void Page_Load(object sender, EventArgs e)
        {
            thisPage = this;
        }
     
        public static RadComboBox cbxManagers
        {
            get
            {
                RadComboBox rc = (RadComboBox)findControl(thisPage, "_cbxManagers");
                // if it's not found, return something that won't bomb out the calling page
                if (rc == null)
                    rc = new RadComboBox();
                return rc;
            }
        }
     
        // function to loop through all controls starting with ctrl
        public static Control findControl(Control ctrl, string ID)
        {
            if (ctrl != null)
            {
                Control cl2;
                foreach (Control cl in ctrl.Controls)
                    if (cl.ID == ID)
                        return cl;
                    else
                        if (cl.HasControls())
                        {
                            cl2 = findControl(cl, ID);
                            if (cl2 != null && cl2.ID == ID)
                                return cl2;
                        }
            }
            return null;
        }
    }
     
    // Then, in the page assigned to the ContentUrl
     
        private RadComboBox cbxManagers
        {
            get
            {
                return Default.cbxManagers;
            }
        }
Back to Top