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

Combobox and Tooltip

1 Answer 66 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Burt Kroner
Top achievements
Rank 1
Burt Kroner asked on 28 Dec 2010, 11:34 PM
I have a combobox on my page and want to have a tooltip applied to each item in the combobox.
Similar to what is shown for the Telerik RadTree at http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltiptreeview/defaultvb.aspx is the "look" I want for the Combobox Items.

Protected Sub RadComboBox1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles RadComboBox1.ItemCreated
For Each domElementID As String In e.Item.Value
'  use domElementID.ToString()  to load a tooltip similar to the link I provided above
Next
End Sub

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 29 Dec 2010, 02:38 PM
Hi Burt Kroner,

Let me suggest you use the RadToolTipManager client-side API in order to add RadToolTips to RadComboBox items. You can handle the OnClientFocus event in this manner:
function OnClientFocusHandler(sender, eventArgs) {
    var items = sender.get_items();
    var tooltipManager = $find("<%= RadToolTipManager1.ClientID%>");
 
    for (i = 0; i < items.get_count(); i++) {
        var li = items.getItem(i).get_element();
        li.id = items.getItem(i).get_value()
        var tooltip = tooltipManager.createToolTip(li);
        tooltip.set_text(items.getItem(i).get_text());
        tooltip.set_value(items.getItem(i).get_value());
    }
}

In order to customize the "look" of the RadToolTip you can create a user control as described at the online demo.
Please find more details at the sample attached.

All the best,
Kalina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ComboBox
Asked by
Burt Kroner
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or