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

<i>Enable</i> and <i>Visible</i> properties issue

0 Answers 57 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Rodrigo Selada
Top achievements
Rank 1
Rodrigo Selada asked on 08 Jul 2009, 04:24 PM

Hi!

I've been trying to construct a page with several RadTabStrips and corresponding PageViews with the invisible status enabled (visible = false). Unfortunately, when I have an postbacks (With or without RadAjaxManager) the RadPageViews lose the false state of the enable and visible properties to their original value: true. The RadTabs maintain the false value for both enable and visible properties. I have enableViewState set to true in both controls.

Is this an problem in my application, an telerik problem or something that I'm not gething it?

Here is the log of my Page Load (!Postback) with 4 RadTabs and 4 PageViews:
Tab: i0; enable: True; visible:True hash: 1041383
Tab: i1; enable: True; visible:True hash: 21869055
Tab: i2; enable: True; visible:True hash: 56596981
Tab: i3; enable: False; visible:False hash: 47685916
RadPageView: wuc1; enable: True; visible:True hash: 61880160
RadPageView: wuc2; enable: True; visible:True hash: 24414944
RadPageView: wuc3; enable: True; visible:True hash: 42951790
RadPageView: wuc4; enable: False; visible:False hash: 29572360

Here is my second log in the page_load event in my first a postback with an added RadTab and PageView:
Tab: i0; enable: True; visible:True hash: 2919477
Tab: i1; enable: True; visible:True hash: 61309027
Tab: i2; enable: True; visible:True hash: 12421168
Tab: i3; enable: False; visible:False hash: 59517951   ------> OK
RadPageView: wuc1; enable: True; visible:True hash: 41917428
RadPageView: wuc2; enable: True; visible:True hash: 7850760
RadPageView: wuc3; enable: True; visible:True hash: 30648237
RadPageView: wuc4; enable: True; visible:True hash: 39633220    ------> Expected FAlse in both properties


ASPX code:
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
</telerik:RadTabStrip> 
 
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" OnPageViewCreated="RadMultiPage1_PageViewCreated"
</telerik:RadMultiPage> 


My C# code:
  
    protected void Page_Load(object sender, EventArgs e) 
    { 
        Ajax.Utility.RegisterTypeForAjax(typeof(RTS)); 
 
        if (!Page.IsPostBack) 
        { 
            Session.Add("wucNum", 1); 
            AddTab("wuc"true); 
            AddTab("wuc"true); 
            AddTab("wuc"true); 
            AddTab("wuc"false); 
         } 
   } 
 
 private void AddTab(string tabName, bool isEnabled) 
    { 
        int wucNum = (int)Session["wucNum"]; 
 
        RadTab tab = new RadTab(); 
        tab.Text = tabName + (int)Session["wucNum"] + " " + isEnabled; 
        tab.Enabled = isEnabled; 
        tab.Visible = isEnabled; 
        RadTabStrip1.Tabs.Add(tab); 
        RadTabStrip1.Tabs[RadTabStrip1.Tabs.Count - 1].Selected = true
 
        RadPageView pageView = new RadPageView(); 
        pageView.Enabled = isEnabled; 
        pageView.Visible = isEnabled; 
        pageView.ID = tabName + (int)Session["wucNum"] + " " + isEnabled; 
        RadMultiPage1.PageViews.Add(pageView); 
    } 
 
    protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e) 
    { 
            string userControlName = e.PageView.ID.Substring(0, 3) + ".ascx"
 
            Control userControl = Page.LoadControl(userControlName); 
            userControl.ID = e.PageView.ID + "_userControl"
            e.PageView.Controls.Add(userControl); 
     } 






No answers yet. Maybe you can help?

Tags
TabStrip
Asked by
Rodrigo Selada
Top achievements
Rank 1
Share this question
or