RadListBox对象
下表列出了客户端最重要的方法RadListBox对象:
名字 | 参数 | 返回类型 | 描述 |
---|---|---|---|
trackChanges | 没有一个 | 没有一个 | 开始跟踪对列表框所做的更改,这些更改将在回发时保留。 |
commitChanges | 没有一个 | 没有一个 | 将上次调用trackChanges后所做的更改写入列表框,以便在回发时保留这些更改。(见示例1) |
findItemByText | 字符串 | RadListBoxItem | 返回第一个RadListBoxItem的对象文本属性等于传递的参数。 |
findItemByValue | 字符串 | RadListBoxItem | 返回第一个RadListBoxItem的对象价值属性等于传递的参数。 |
findItemByAttribute | 字符串(属性名),字符串(属性值) | RadListBoxItem | 的第一个实例RadListBoxItem使用指定的属性/值对。 |
clearSelection | 没有一个 | 没有一个 | 清除所选内容。没有选中的项目。 |
clearSelectionExcept | int或RadListBoxItem | 没有一个 | 清除除指定索引或项外的当前选择项。 |
getItem | int | RadListBoxItem | 从位于参数指定的索引处的项集合中获取项。 |
get_item | 没有一个 | RadListBoxItemCollection | 获取包含所有项的集合 |
get_selectedItem | 没有一个 | RadListBoxItem | 获取所选项(如果为,则获取第一个所选项)SelectionMode = "多"). |
get_selectedItems | 没有一个 | 数组 | 获取所选RadListBoxItem对象的数组 |
get_selectedIndex | 没有一个 | int | 获取所选项的索引 |
get_checkedItems | 没有一个 | 数组 | 获取选中的RadListBoxItem对象的数组 |
reorderItem | RadListBoxItem和索引 | 没有一个 | 将指定的项移动到指定的索引 |
transferToDestination | RadListBoxItem | 没有一个 | 控件指定的列表框中传输指定的项TransferToID财产 |
transferFromDestination | RadListBoxItem | 没有一个 | 控件指定的列表框中传输指定的项TransferToID财产 |
transferItem | RadListBoxItem, SourceRadListBox, DestinationRadListBox | 没有一个 | 将指定项从源列表框传输到目标列表框 |
get_element | 没有一个 | HTML元素 | 获取RadListBox的外部DIV |
get_childListElement | 没有一个 | HTML元素 | 获取RadListBox的UL元素 |
get_id | 没有一个 | 字符串 | 获取RadListBox的ClientID |
deleteItem | RadListBoxItem | 没有一个 | 删除作为参数传递的项 |
insertItems | RadListboxItems的数组 | 没有一个 | Bulk将RadListbox项数组插入到RadListbox中 |
set_visible | 布尔 | 没有一个 | 将listview设置为在客户端可见或不可见 |
函数AddNewItem() {var listbox = $find("<%= RadListBox1. "ClientID % > ");var item = new Telerik.Web.UI.RadListBoxItem();item.set_text(“项目”);listbox.trackChanges ();listbox.get_items阀门()(项目);item.select ();listbox.commitChanges ();}