wpf-devexpress-dot-xpf-dot-editors-dot-lookupeditbase-f665de2c.md
Gets or sets the index of the selected item. This is a dependency property.
Namespace : DevExpress.Xpf.Editors
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public int SelectedIndex { get; set; }
Public Property SelectedIndex As Integer
| Type | Description |
|---|---|
| Int32 |
An integer value that specifies the index of the selected item. -1 if there is no selected item.
|
To obtain the selected item, use the LookUpEditBase.SelectedItem property. Each time the selected item is changed, the LookUpEditBase.SelectedIndexChanged event is raised.
If the editor represents a checked combobox, use the LookUpEditBase.SelectedItems property, to obtain a collection of the selected items. In this instance, if multiple items are selected, the SelectedIndex property returns the index of the first selected item.
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-use-devexpress-theme-in-applications/CS/DevExpress.Examples.ThemeSwitcher/MainWindow.xaml#L40
<dxe:ComboBoxEdit VerticalAlignment="Center" Width="200" x:Name="cbLocalTheme" SelectedIndex="15" ValueMember="Name"
ItemsSource="{Binding Source={x:Static dx:Theme.Themes}}" />
wpf-themes-use-palette-resources-in-custom-controls/CS/DXSample/MainWindow.xaml#L10
<StackPanel>
<dxe:ComboBoxEdit Grid.Row="0" x:Name="comboBoxEdit1" NullText="Select a theme..." IsTextEditable="False" EditValueChanged="comboBoxEdit1_EditValueChanged" SelectedIndex="0">
<dxe:ComboBoxEdit.ItemsSource>
See Also