Skip to main content
Tab

ASPxComboBox.SelectedItem Property

Specifies the selected item in the editor list.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public ListEditItem SelectedItem { get; set; }

Property Value

Type Description
ListEditItem

The selected item.

Remarks

Use the SelectedItem property to get or set the selected item within the ASPxComboBox editor. Use the SelectedIndexChanged event to handle the item selection.

<dx:ASPxComboBox ID="ASPxComboBox1" runat="server">
    <Items>
        <dx:ListEditItem Text="Afghanistan" Value="1" />
        <!-- ... -->
    </Items>
</dx:ASPxComboBox>
protected void Page_Load(object sender, EventArgs e){
    ASPxComboBox1.SelectedItem = ASPxComboBox1.Items.FindByText("Andorra");
}

If the SelectedItem property returns null, make sure that you set the ValueType property to an .NET type that matches the ValueField column type. Otherwise, the editor cannot find the corresponding item because the editor’s ValueType property does not match the item type (String by default).

See Also