Skip to main content

ASPxClientComboBox.GetSelectedIndex Method

Returns the index of the selected item within the combo box editor.

Declaration

GetSelectedIndex(): number

Returns

Type Description
number

The index of the selected item.

Remarks

Use the GetSelectedIndex method to identify the editor’s selected item by its index. A value of 1 indicates that no item is currently selected within the list editor.

function onSelectedIndexChanged(sender, target) {
    if (sender.PrevIndex != undefined) {
        target.SetItemTooltip(sender.PrevIndex, "");
        target.RemoveItemCssClass(sender.PrevIndex, "MySelectedItem");
    }
    target.SetItemTooltip(sender.GetSelectedIndex(), "This item is selected in another combobox");
    target.AddItemCssClass(sender.GetSelectedIndex(), "MySelectedItem");
    sender.PrevIndex = sender.GetSelectedIndex();
}

View Example: How to customize an item's appearance

See Also