3 Answers, 1 is accepted
0
Hello Randy,
Indeed RadComboBoxItemData does not expose a ToolTip property. You can use the Attributes collection instead to return the ToolTip. Later in the OnClientItemsRequested event handler you can iterate through all Items in the Combo and set a ToolTip for their HTML elements.
[In the Web Service Web method]
[In OnClientItemsRequested event handler]
This should do the work.
All the best,
Simon
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Indeed RadComboBoxItemData does not expose a ToolTip property. You can use the Attributes collection instead to return the ToolTip. Later in the OnClientItemsRequested event handler you can iterate through all Items in the Combo and set a ToolTip for their HTML elements.
[In the Web Service Web method]
itemData.Attributes["ToolTip"] = "some tooltip text"; |
[In OnClientItemsRequested event handler]
function clientItemsRequested(sender, eventArgs) |
{ |
var items = sender.get_items(); |
for (var itemIndex = 0; itemIndex < items.get_count(); itemIndex++) |
{ |
var item = items.getItem(itemIndex); |
item.get_element().title = item.get_attributes().getAttribute("ToolTip"); |
} |
} |
This should do the work.
All the best,
Simon
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Bryan Brannon
Top achievements
Rank 2
answered on 11 Feb 2009, 06:45 PM
I want to do something very similar, attaching a style attribute to color the text based on some logic in the webservice;
If ... Then
itemData.Attributes.Add("style", "color:green")
Else
itemData.Attributes.Add("style", "color:red")
End If
This does not work using my method from the Webservice that returns RadComboBoxItemData.
Any help?
If ... Then
itemData.Attributes.Add("style", "color:green")
Else
itemData.Attributes.Add("style", "color:red")
End If
This does not work using my method from the Webservice that returns RadComboBoxItemData.
Any help?
0

Bryan Brannon
Top achievements
Rank 2
answered on 11 Feb 2009, 06:54 PM
Sorry, with a bit of playing around I finally got it:
Webservice Method:
If ... Then
itemData.Attributes.Add("Color", "green")
Else
itemData.Attributes.Add("Color", "red")
End If
My RadComboBox.OnClientItemsRequested event: (eval the custom attribute, color the items)
Webservice Method:
If ... Then
itemData.Attributes.Add("Color", "green")
Else
itemData.Attributes.Add("Color", "red")
End If
My RadComboBox.OnClientItemsRequested event: (eval the custom attribute, color the items)
function ClientItemsRequested(sender, eventArgs) { |
var items = sender.get_items(); |
for (var itemIndex = 0; itemIndex < items.get_count(); itemIndex++) { |
var item = items.getItem(itemIndex); |
item.get_element().style.color = item.get_attributes().getAttribute("Color"); |
} |
} |