Use different Template for Active Tab

2 posts, 0 answers
  1. Albert
    Albert avatar
    2 posts
    Member since:
    Nov 2012

    Posted 14 Mar 2013 Link to this post

    Does anyone know if there is a way to use a different template for the Active tab as opposed to the inactive tabs?

    I have a button I want only on the active tab and I don't want it to show on the other tabs. Is there a way to do this? I'm not finding anything in the demo pages or the documentation.

    Any help with this would be greatly appreciated.
    Thanks.
  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 19 Mar 2013 Link to this post

    Hello Albert,

    I can suggest you a slight different approach. You could use the PreRender event to loop through the RadTabs collection and manage the visibility of the buttons, which are nested in the disabled tabs. Consider the following approach :

    protected void Page_PreRender(object sender, EventArgs e)
       {
           for (int i = 0; i < RadTabStrip1.Tabs.Count; i++)
           {
               RadTab tab = RadTabStrip1.Tabs[i];
               Button c = (Button)tab.FindControl("Button1");
               c.Visible = !tab.Enabled;
           }
       }



    Regards,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top