I am trying to write an application which dynamically adds a tab to a tab strip and a pageview to the multipage and at the same time adds a control to the multi page (my current example uses a button).
I am sucessfully doing all this apart from I have an issue with my code whic is as follows:
when i create the tab and add the button it adds fine but when i press the button the control dissapears from the multipage
any ideas?
I am sucessfully doing all this apart from I have an issue with my code whic is as follows:
when i create the tab and add the button it adds fine but when i press the button the control dissapears from the multipage
any ideas?
<asp:Button ID="Button3" runat="server" Text="Button" onclick="Button3_Click" /> | |
<telerik:RadTabStrip ID="ReportTabs" runat="server" SelectedIndex="0" MultiPageID="ReportMultipage"> | |
<Tabs> | |
<telerik:RadTab runat="server" Selected="True" Text="Chart" PageViewID="ReportChartPage"> | |
</telerik:RadTab> | |
<telerik:RadTab runat="server" Text="Root RadTab2" PageViewID="RadPageView1"> | |
</telerik:RadTab> | |
</Tabs> | |
</telerik:RadTabStrip> | |
<telerik:RadMultiPage ID="ReportMultipage" runat="server" OnPageViewCreated ="RadMultiPage1_PageViewCreated" > | |
<telerik:RadPageView ID="ReportChartPage" runat="server" Selected="true" > | |
<asp:Button ID="Button1" runat="server" Text="Button" /> | |
</telerik:RadPageView> | |
<telerik:RadPageView ID="RadPageView1" runat="server" > | |
<asp:Button ID="Button2" runat="server" Text="Button2" /> | |
</telerik:RadPageView> | |
</telerik:RadMultiPage> |
protected void Button3_Click(object sender, EventArgs e) | |
{ | |
Guid gu = new Guid(); | |
gu = System.Guid.NewGuid(); | |
RadPageView page = new RadPageView(); | |
page.ID = "Page" + gu.ToString(); | |
Button but = new Button(); | |
but.Text = gu.ToString(); | |
but.ID = "button" + gu.ToString(); | |
page.Controls.Add(but); | |
ReportMultipage.PageViews.Add(page); | |
RadTab tab = new RadTab(); | |
tab.Text = gu.ToString(); | |
tab.PageViewID = "Page" + gu.ToString(); | |
ReportTabs.Tabs.Add(tab); | |
ReportMultipage.SelectedIndex = 0; | |
} |