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

Using RadPageView content url page how to get RadMultiPage

2 Answers 107 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
godbrother
Top achievements
Rank 1
godbrother asked on 07 Feb 2014, 04:41 AM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 11 Feb 2014, 09:13 AM
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.
0
Dave
Top achievements
Rank 1
answered on 18 Feb 2014, 08:57 PM
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;
        }
    }
Tags
TabStrip
Asked by
godbrother
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Dave
Top achievements
Rank 1
Share this question
or