Skip to main content
A newer version of this page is available. .

ComboBoxSettings.SelectedIndex Property

Gets or sets the selected list item’s index.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v19.2.dll

Declaration

public int SelectedIndex { get; set; }

Property Value

Type Description
Int32

An integer value, representing the zero-based index of the selected list item.

Remarks

Use the SelectedIndex property to control selection within the ComboBox editor. The default value specifies that no item is selected within the editor.

Html.DevExpress().ComboBox(
    settings => {
        settings.Name = "comboBox1";

        settings.Width = 180;
        settings.SelectedIndex = 0;
        settings.Properties.DisplayFormatString = "DXp v. {0}";
        settings.Properties.ValueType = typeof(string);

        settings.Properties.Items.Add("2009.3");
        settings.Properties.Items.Add("2010.1");
        settings.Properties.Items.Add("2010.2");
    }
).GetHtml();
See Also