New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

OnClientItemDataBound

The OnClientItemDataBound client-side event occurs for each item that is created during WebService(including if ODataSource is used).

The event handler receives two parameters:

  1. The instance of the DropDownList firing the event.

  2. An eventArgs parameter containing the following methods:

    • get_item() returns a RadDropDownListItem client-object

    • get_dataItem() returns a reference to the DataItem that the current Item is being bound to.

The following example shows how a value is extracted from the DataItem and set as a Custom Attribute to Items loaded via a Web Service:

JavaScript
	
function onItemDataBound(sender, eventArgs) {
    var item = eventArgs.get_item();
    var dataItem = eventArgs.get_dataItem();
    var phone = dataItem.Phone;
    item.get_attributes().setAttribute("phone", phone);
}
	
Not finding the help you need?
Contact Support