ASPxClientComboBox.SetSelectedItem(item) Method
In This Article
Sets the list editor’s selected item.
#Declaration
TypeScript
SetSelectedItem(
item: ASPxClientListEditItem
): void
#Parameters
Name | Type | Description |
---|---|---|
item | ASPx |
An ASPx |
#Remarks
Use the SetSelectedItem method on the client side to specify the selected item within the combobox editor. If a null value is passed as the parameter, no item will be selected within the editor.
The following example illustrates how to use the SetSelectedItem method.
function onLostFocus(s, e) {
for (var i = 0; i < ComboBox.GetItemCount() ; i++) {
var item = ComboBox.GetItem(i);
if (item.GetColumnText('Text').toLowerCase() == s.GetText().toLowerCase()) {
ComboBox.SetSelectedItem(item);
break;
}
}
if (ComboBox.GetValue() == null)
ComboBox.SetText(s.GetText());
}
See Also