RadToolTip for RadComboBox

Article Info

Rating: 5

Article information

Article relates to

 RadToolTip for ASP.NET AJAX,
 RadComboBox for ASP.NET AJAX

Created by

 Svetlina, Telerik



HOW-TO:

Tooltipify each element of a RadComboBox



SOLUTION:

The standard asp DropDownList control cannot be configured to display even the plain [browser] tooltip due to having OPTION elements in its HTML representation and the OPTION element is not a real HTML object.

Tooltipifying a RadComboBox, however, is possible and pretty easy. In order to achieve the desired behavior you should simply pu a RadToolTip control in the Item Template of the RadComboBox as shown below:

  <telerik:RadComboBox ID="RadComboBox1" runat="server" DataSourceID="AccessDataSource1" 
            DataTextField="ContactName">  
            <ItemTemplate> 
                <asp:Label runat="server" ID="Label1" Text='<%# Eval("ContactName")%> '></asp:Label> 
                <telerik:RadToolTip ID="RadToolTip1" runat="server" Width="100" Height="10" TargetControlID="Label1" 
                    Position="BottomRight" Text='<%# Eval("ContactName")%>'>  
                </telerik:RadToolTip> 
            </ItemTemplate> 
            <CollapseAnimation Duration="200" Type="OutQuint" /> 
        </telerik:RadComboBox> 

In case you want to have a single RadToolTip for the whole RadComboBox control, you should simply set its ID as a TargetControlID of the RadToolTip:

 <telerik:RadToolTip ID="RadToolTip1" runat="server" Width="100" Height="10" Position="BottomRight" 
            Text='This is a single tooltip for the whole RadComboBox control' TargetControlID="RadComboBox2">  
        </telerik:RadToolTip> 


You can find a sample, working project which demonstrates the described scenarios in the attached project.

Comments

If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.