Count items in Telerik’s RadComboBox


Description:

It is general requirement to show and count number of items in Telerik’s RadComboBox. And we can do that by using a simple javascript function.

Code:

In javasript:

function UpdateItemCountField(sender, args) {

//set the footer text

sender.get_dropDownElement().lastChild.innerHTML = “A total of “ + sender.get_items().get_count() + ” items”;

}

In aspx page:

add footer template as shown below code.

<FooterTemplate>

A total of

<asp:Literal runat=”server” ID=”RadComboItemsCount” />

items

</FooterTemplate>

Advertisements