Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

Applying different styles to different items of ASPxComboBox using both server-side and client-side functionally

$
0
0

This example demonstrates how to apply different styles to different elements of the ASPxComboBox.
To do so, you should handle the ASPxComboBox.DataBound event and manually modify the text of items whose style you need to change. Please note that ASPxComboBox must have at least one string column or have no columns at all.

In the first case, you should work with ASPxComboBoxItem.GetValue and ASPxComboBoxItem.SetValue methods and in the second one, with the ASPxComboBoxItem.Text property. In both cases, you should add

[HTML]
<spanclass="someClass">
to the text of the target item and set ASPxComboBox.EncodeHtml property to false. If this property is true, html tags will be displayed like common text.

Finally, on the client side, you should change styles of elements marked by a specific class.

Please see this example for more details.


Viewing all articles
Browse latest Browse all 7205

Trending Articles