ASPxClientComboBox.SetSelectedIndex(index) Method

Sets the combobox editor's selected item specified by its index.


SetSelectedIndex(index: number): void


Name Type Description
index number

An integer value specifying the zero-based index of the item to select.


Use the SetSelectedIndex method on the client side to specify the selected item's index in the combobox editor. If you pass -1 as the parameter, no item is selected in the editor.

<script type="text/javascript" >
function OnClick(s, e) {

<dxe:ASPxComboBox ID="ASPxComboBox1" runat="server" width="200px" MaxLength="50" ClientInstanceName="comboBox">
        <dxe:ListEditItem Text="Contract" Value="0" />
        <dxe:ListEditItem Text="Full Time" Value="1" />
        <dxe:ListEditItem Text="Part Time" Value="2" />

<dx:ASPxButton ID="ASPxButton1" runat="server" Text="Select Item by Index" AutoPostBack="false">
    <ClientSideEvents Click="OnClick" />

Online Example

See Also