ASPxClientComboBox.SetText(text) Method
Specifies the text displayed within the editor’s edit box.
#Declaration
SetText(
text: string,
applyFilter?: boolean
): void
#Parameters
Name | Type | Description |
---|---|---|
text | string | A string value specifying the editor’s text. |
apply |
boolean |
|
#Remarks
A call to this method changes the editor’s value (selected index) and applies the specified text as a filter to the editor.
If the text passed to this method matches the text of an item from the editor’s item collection, this item is selected. The editor’s value changes to the item’s associated value. If there is no item whose associated text matches the specified text, the editor’s selected index changes to -1. In this case, the editor’s value is assigned with the text passed via the text parameter.
Note
If a callback mode is enabled (the ASPxtrue
) the Set
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());
}