Thursday, December 12, 2024

Controls / ComboBox / RadComboBox Items / Custom Attributes

 

Custom Attributes

RadComboBox items provide a special collection called Attributes. You can use this collection to expand the information stored with the items. The Attributes collection lets you store any number of attributes as name / value pairs. You can specify custom attributes declaratively in the RadComboBoxItem tag or programmatically using the Attributes collection of the RadComboBoxItem. You can also access custom attributes client-side, using the get_attributes collection of the RadComboBoxItem client-side object.

Using attributes declaratively

This example shows how to use custom attributes declaratively to display extra information in RadComboBox items:

To customize RadComboBox items, this example uses an item template. The custom attributes of the item are used to bind the controls in the template. The template controls are bound using data-binding expressions with typical ASP.NET format and syntax, e.g. "<%# DataBinder.Eval(Container, "Attributes['ImagePath']") %>". Both ImagePath and DisplayName are custom attributes.


No comments:

Post a Comment