Hi,
I am having a dynamic tab control and multipage control. When I add new tab and pageview when in a button click,
I am having a dynamic tab control and multipage control. When I add new tab and pageview when in a button click,
radMultiPage_PageViewCreated(object sender, RadMultiPageEventArgs e) event fire and initialize the conntrol Requirement : when I select a item from dropdown and click add button. New tab and page view should be added. Load usercontrol Inside the page view HTML --
<asp:dropdownlist id="ddlLanguages" runat="server"> </asp:dropdownlist> <asp:linkbutton id="lbtAddLanguage" runat="server" text="Add" tooltip="Click to add this language"></asp:linkbutton> <asp:panel id="pnlOuter" runat="server"> <div id="divTab" runat="server"> <asp:label id="lblTime" runat="server"></asp:label> <rad:radtabstrip id="TabStrip" runat="server" multipageid="MultiPage" autopostback="False"> <tabs> </tabs> </rad:radtabstrip> <rad:radmultipage id="MultiPage" runat="server"> </rad:radmultipage> </div> </asp:panel>
Code --protected override void OnInit(EventArgs e) { lbtAddLanguage.Click += new EventHandler(lbtAddLanguage_Click); MultiPage.PageViewCreated += new RadMultiPageEventHandler(radMultiPage_PageViewCreated); }void lbtAddLanguage_Click(object sender, EventArgs e) { RadTab tab = new RadTab(); ListItem item = ddlLanguages.SelectedItem; tab.Text = item.Text; RadPageView view = new RadPageView(); view.ID = item.Value; tab.PageViewID = view.ID; tab.Selected = true; TabStrip.Tabs.Add(tab); MultiPage.PageViews.Add(view); }void radMultiPage_PageViewCreated(object sender, RadMultiPageEventArgs e) { Details detailControl = LoadControl(Constant.CONTROL_WIZARD_DETAILS) as Details; if (detailControl != null) { detailControl.SelectedLanguage = GetLanguage(); detailControl.LoadControls(); e.PageView.Controls.Add(detailControl); } }My issue is, When I click the button to add tabs, PageViewCreated event fires before the button click and try to Initialize all the page views. How can we stop this. Thanks