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

How do you create a ToolTip for a Tab?

2 Answers 110 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
LeBear
Top achievements
Rank 1
LeBear asked on 20 Apr 2008, 06:09 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Paul
Telerik team
answered on 23 Apr 2008, 07:44 AM
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
0
LeBear
Top achievements
Rank 1
answered on 23 Apr 2008, 10:30 AM
Thank you.

That did the trick!
Tags
ToolTip
Asked by
LeBear
Top achievements
Rank 1
Answers by
Paul
Telerik team
LeBear
Top achievements
Rank 1
Share this question
or