Problem with TabPanel Control ActiveTab

  1. #1

    Problem with TabPanel Control ActiveTab

    Hello everybody,

    The ActiveTab propriety does not work for me and has always the value -1.

    This is my code:

    Page.aspx

    <ext:TabPanel ID="tabs"  runat="server" AutoPostBack="true"    Title="TabPanel">
                             
    </ext:TabPanel>
    Page.aspx..cs

    protected void Page_Load(object sender, EventArgs e){
    
    
    tabs.TabWidth = Unit.Pixel(135);
    tabs.EnableTabScroll = true;
    tabs.AutoPostBack = true;
    tabs.TabChanged += new EventHandler(tabs_TabChanged);
     
    Tab tab1 = new Tab();
    tabMytheme.AutoWidth = true;
    tabMytheme.ID = "tab1";
    
    Tab tab2 = new Tab();
    tabMytheme.AutoWidth = true;
    tabMytheme.ID = "tab2"; tabs.Tabs.Add(tab1);
    tabs.Tabs.Add(tab2);
    ...
    }
    .....
    protected void tabs_TabChanged(object sender, EventArgs e)
    { 
    TabPanel tabpanel = (TabPanel)sender;
    Tab tab = tabpanel.Tabs[tabpanel.ActiveTab];   // The tabpanel.ActiveTab has always the value -1
    string idProgramme = tab.ID;
    ...
    }

    Thank you for help !

  2. #2

    RE: Problem with TabPanel Control ActiveTab

    Problem resolved !

    I have replaced

    <ext:TabPanel ID="tabs"  runat="server" AutoPostBack="true"    Title="TabPanel">
    </ext:TabPanel>
    by

    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    And I have added this

    this.PlaceHolder1.Controls.Add(tabs);
  3. #3

    RE: Problem with TabPanel Control ActiveTab

    Thanks for the update.

    I feel your original attempt should have worked, and I suspected there was a problem in the TabPanel's LoadPostData Method. I'm going to try and figure exactly what is going wrong.
    Geoffrey McGill
    Founder & CEO

Similar Threads

  1. [CLOSED] Tabpanel and ActiveTab
    By reinout.mechant@imprss.be in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Aug 25, 2009, 3:55 PM
  2. TabPanel.ActiveTab question
    By ydnah2 in forum 1.x Help
    Replies: 2
    Last Post: Aug 04, 2009, 10:15 PM
  3. Get TabPanel ActiveTab inside Other TabPanel.
    By grmontero in forum 1.x Help
    Replies: 1
    Last Post: Jul 16, 2009, 11:45 AM
  4. TabPanel ActiveTab.ID error in AjaxMethod
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 08, 2008, 6:57 AM
  5. [CLOSED] Breaking changes on TabPanel ActiveTab
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Oct 14, 2008, 12:52 PM

Posting Permissions