I am testing the trial version of Telerik controls and need to assess how it will handle a very specific situation. I am using a close derivative of the load on demand sample. The key differences are that each pageview uses the same control and I also have a public property that I set to control the pageview. The problem I am facing is that nothing displays onload or when I change tabs. Below is the code that is used on the tab page. Below I will mark the lines that are different from the Load on Demand Sample. Does anybody have an idea as to what I am doing wrong?
<telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1"> </telerik:RadAjaxLoadingPanel> <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadTabStrip1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /> <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadMultiPage1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadMultiPage1"
LoadingPanelID="LoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <script type="text/javascript"> function onTabSelecting(sender, args) { if (args.get_tab().get_pageViewID()) { args.get_tab().set_postBack(false); } } </script> <div style="float:left;"> <telerik:RadTabStrip OnClientTabSelecting="onTabSelecting" ID="RadTabStrip1" SelectedIndex="0" CssClass="tabStrip" runat="server" MultiPageID="RadMultiPage1" Skin="Sitefinity" OnTabClick="RadTabStrip1_TabClick" Orientation="VerticalLeft"> </telerik:RadTabStrip> </div> <div style="float:left;"> <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated" > </telerik:RadMultiPage></div>
and here is the Code Behind.
protected void Page_Load(object sender, EventArgs e){ if (!Page.IsPostBack) {
//This is different I am using a datasource to generate the tabs RSOracleData RSOD = new RSOracleData(); RSOD.ConnString = ConfigurationManager.ConnectionStrings["OracleConnection"].ToString(); DataSet DS = RSOD.GetPageTabs(Thread.CurrentThread.CurrentUICulture.ToString(), "Laws"); RadTabStrip1.DataSource = DS; RadTabStrip1.DataTextField = "TABNAME"; RadTabStrip1.DataValueField = "TABID"; RadTabStrip1.DataBind(); if (DS.Tables.Count > 0) { AddPageView(RadTabStrip1.FindTabByText(DS.Tables[0].Rows[0]["TABNAME"].ToString())); } } }
private void AddTab(string tabName){ RadTab tab = new RadTab(); tab.Text = tabName; RadTabStrip1.Tabs.Add(tab); } protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e) { //This is different I am loading one particular control and setting a property in it
webproject1.Controls.PageViewGrid PVControl = new webproject1.Controls.PageViewGrid(); PVControl.PageViewID = Convert.ToInt32(e.PageView.ID.Replace("PV", "")); PVControl.ID = e.PageView.ID + "_userControl"; e.PageView.Controls.Add(PVControl); } private void AddPageView(RadTab tab) { RadPageView pageView = new RadPageView();
//I am using a value to determine the tab instead of using the text pageView.ID = "PV" + tab.Value; RadMultiPage1.PageViews.Add(pageView); tab.PageViewID = pageView.ID; }
protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e) { AddPageView(e.Tab); e.Tab.PageView.Selected = true; }