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

RadListBoxItem Object

The RadListBoxItem object is returned by the getItem method of the RadListBox or RadListBoxItemCollection object. It is also exposed by the event arguments of many client-side events (eventArgs.get_item()). The following table lists the most important methods:

  

NameParametersReturn TypeDescription
get_textnonestringGets the Text of the item
get_valuenonestringGets th Value of the item
get_attributesnoneCollectionReturns the collection of custom attributes for the item.(see Example 1)
enablenonenoneEnables the item if it is disabled
disablenonenoneDisables the item if it is enabled
selectnonenoneSelects the item (equal to set_selected(true) )
unselectnonenoneUnselects the item (equal to set_selected(false) )
checknonenoneChecks the item (equal to set_checked(true) )
unchecknonenoneUn-checks the item (equal to set_checked(false) )
clonenoneRadListBoxItemCreates a new item by copying the properties of the source item
get_isVisiblenoneboolReturns whether the item is visible
scrollIntoViewnonenonePuts the item at the bottom of the visible area
ensureVisiblenonenoneIf the item is not visible - puts it at the top of the visible area
get_listBoxnoneRadListBoxGets the RadListBox client-object
get_selectednoneboolReturns whether the item is selected
set_selectedboolnoneSelects the item
get_checkednoneboolReturns whether the item is checked
set_checkedboolnoneChecks the item
get_checkablenoneboolReturns whether the item can be checked
set_checkableboolnoneSets whether the item can be checked
get_imageUrlnonestringGets the value of the ImageUrl property
set_imageUrlstringnoneSets the ImageUrl property of the item
get_toolTipnonestringGets the tooltip of the item
set_toolTipstringnoneSets the tooltip of the item
get_allowDragnoneboolReturns whether the item can be dragged
set_allowDragboolnoneSets the AllowDrag property (whether the item can be dragged)
get_elementnoneHTML elementReturns the
  • element of the item
  • get_textElementnoneHTML elementReturns the element of the item
    get_imageElementnoneHTML elementReturns the image element of the item
    get_checkBoxElementnoneHTML elementReturns the checkbox element of the item
    get_cssClassnonestringGets the cssClass of the RadListBoxItem.
    set_cssClassstringnoneSets the cssClass of the RadListBoxItem.

     Example 1: Demonstrates the usage of the get_attributes method

    JavaScript
    var listbox = $find("<%= RadListBox1.ClientID %>");
    var foundItem = listbox.findItemByAttribute("Population", "0");
    var attributes = foundItem.get_attributes();
    var size = attributes.getAttribute("size");
    if (size) {
    	attributes.setAttribute("Population", size);
    	attributes.removeAttribute("size");
    }
    else {
    	attributes.setAttribute("Population", "Unknown");
    }

    See Also

    In this article
    See Also
    Not finding the help you need?
    Contact Support