Back to Devexpress

ListBoxEdit.SelectedIndex Property

wpf-devexpress-dot-xpf-dot-editors-dot-listboxedit-51dc0659.md

latest3.2 KB
Original Source

ListBoxEdit.SelectedIndex Property

Gets or sets the index of the currently selected item. This is a dependency property.

Namespace : DevExpress.Xpf.Editors

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public int SelectedIndex { get; set; }
vb
Public Property SelectedIndex As Integer

Property Value

TypeDescription
Int32

A zero-based integer value that specifies the currently selected item’s index. -1 if no item is selected.

|

Remarks

If multiple item selection is enabled, the SelectedIndex property returns the index of the first element in the ListBoxEdit.SelectedItems collection.

To obtain the currently selected item, use the ListBoxEdit.SelectedItem property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectedIndex property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-grid-scrollbar-annotations/CS/WpfApplication25/MainWindow.xaml#L42

xml
</dxg:GridControl>
<dxe:ListBoxEdit x:Name="myListBoxEdit" Grid.Column="1" Grid.Row="1" SelectedIndex="6">
    <dxmvvm:Interaction.Behaviors>

reporting-wpf-mvvm-show-report-document-preview/CS/MainWindow.xaml#L31

xml
DisplayMember="ReportName" ValueMember="ID"
                 SelectedIndex="0" ShowBorder="False">
</dxe:ListBoxEdit>

wpf-pivot-grid-hide-specific-columns-and-row/CS/WpfApp/MainWindow.xaml#L20

xml
Grid.Row="0"
SelectedIndex="0"
SelectedIndexChanged="radioListBoxEdit_SelectedIndexChanged">

See Also

SelectedItem

SelectionMode

ListBoxEdit Class

ListBoxEdit Members

DevExpress.Xpf.Editors Namespace