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

Server-side: enable tab doesn't affect control

2 Answers 90 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Eugene
Top achievements
Rank 1
Eugene asked on 22 Feb 2009, 01:04 AM
My code

 

    protected void Event(object sender, EventArgs e)        
    {        
        TopTabMenu.Tabs[1].Enabled = true;        
    }    
 

So the general idea is to enable a tab on some event (or condition).

According to http://www.telerik.com/help/aspnet-ajax/tab_tabsserverside.html
it should work, but nonetheless the tab is still disabled after this code is performed.

Can you help me?

 

 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Feb 2009, 11:11 AM
Hello Eugene,

I tried enabling a tab in my RadTabStrip which is initially disabled on a button click and it works as expected. Check out the following code for any differences:
aspx:
  <telerik:RadTabStrip ID="RadTabStrip1" runat="server" > 
     <Tabs> 
         <telerik:RadTab Enabled="false" Text="Tab1" ></telerik:RadTab> 
         <telerik:RadTab  Text="Tab2" ></telerik:RadTab> 
         <telerik:RadTab Text="Tab3" ></telerik:RadTab> 
     </Tabs> 
  </telerik:RadTabStrip> 

cs:
 protected void Button_Click(object sender, EventArgs e) 
    { 
        RadTabStrip1.Tabs[0].Enabled = true
    } 

Thanks
Princy.
0
Eugene
Top achievements
Rank 1
answered on 25 Feb 2009, 07:17 PM

Probably, the root cause can be that code which is enabling tab is located in an *.ascx file (which is included) to a *.aspx - which declares a TabStrip.
Finally I solved it by enabling on client side (i.e. using javascript).

So the code actually was (in ascx):

    protected void Event(object sender, EventArgs e)           
    {           
        ((RadTabStrip)Page.FindControl("TopTabMenu")).Tabs[1].Enabled = true;           
    }       
    
 
Tags
TabStrip
Asked by
Eugene
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Eugene
Top achievements
Rank 1
Share this question
or