New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

OnClientItemDataBound

The OnClientItemDataBound client-side event occurs for each item that is created during WebService Load on Demand. This event is added in 2008 Q3 SP2 release (Telerik.Web.UI.dll v.2008.3.1314).

The event handler receives two parameters:

  1. The instance of the combobox firing the event.

  2. An eventArgs parameter containing the following methods:

  • get_item() returns a RadComboBoxItem client-object

  • get_dataItem() returns a reference to the DataItem (RadComboBoxItemData or any other serializable custom class) that the current Item is being bound to.

  • get_domEvent() is undefined for this event.

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:


function onItemDataBound(sender, eventArgs) 
{
    var item = eventArgs.get_item();
    var dataItem = eventArgs.get_dataItem(); 
    var phone = dataItem.Phone;
    item.get_attributes().setAttribute("phone", phone);
}

Another usage of the DataItem object is in client-side Templates that are about to be introduced with the next version of ASP.NET AJAX. See the following blog post for more details - RadComboBox and ASP.NET AJAX 4.0 Preview – using client-side templates and webservice load on demand.

See Also

In this article