How do you create a ToolTip for a Tab?

3 posts, 1 answers
  1. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 20 Apr 2008 Link to this post

    The RadTab for ASP.Net Ajax doesn't support setting the ID on the tab (a strange shortcoming that defies standard programming practices), and as such, I can't seem to set a RadToolTip to associate with a tab (as I did with the Rad Tab for ASP.Net).

    I've tried:

    RadToolTip1.TargetControlID = ControlTab.FindTabByValue("Info").ClientID
    RadToolTip1.IsClientID = True

    and

    RadToolTip1.TargetControlID = ControlTab.FindTabByValue("Info").ID

    but neither seem to do the trick.
  2. Answer
    Paul
    Admin
    Paul avatar
    4281 posts

    Posted 23 Apr 2008 Link to this post

    Hi Barry,

    You can easily achieve your goal by adding custom id attribute to each tab. Here's a sample code snippet that shows the needed approach.

    ASPX:
    <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server">  
            <Tabs> 
                <telerik:RadTab runat="server" Text="Root RadTab1">  
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab2">  
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab3">  
                </telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <telerik:RadToolTip ID="RadToolTip1" runat="server" IsClientID="true" TargetControlID="tab1">  
            This is Tab1</telerik:RadToolTip> 
        <telerik:RadToolTip ID="RadToolTip2" runat="server" IsClientID="true" TargetControlID="tab2">  
            This is Tab2</telerik:RadToolTip> 
        <telerik:RadToolTip ID="RadToolTip3" runat="server" IsClientID="true" TargetControlID="tab3">  
            This is Tab3</telerik:RadToolTip> 
    </form> 

    Code-behind:
    protected void Page_Load(object sender, EventArgs e)  
    {  
        foreach (RadTab myTab in RadTabStrip1.GetAllTabs())  
        {  
            myTab.Attributes.Add("id""tab" + (myTab.Index + 1));  
        }  


    Regards,
    Paul
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 23 Apr 2008 Link to this post

    Thank you.

    That did the trick!
Back to Top