wpf-devexpress-dot-xpf-dot-accordion-dot-accordioncontrol-d179e143.md
Gets or sets an object that is the currently selected accordion item. This is a dependency property.
Namespace : DevExpress.Xpf.Accordion
Assembly : DevExpress.Xpf.Accordion.v25.2.dll
NuGet Package : DevExpress.Wpf.Accordion
public object SelectedItem { get; set; }
Public Property SelectedItem As Object
| Type | Description |
|---|---|
| Object |
A Object that is the currently selected accordion item.
|
End-users can select one accordion item at a time by default:
You can set the AccordionControl.SelectionMode property to SelectionMode.None to prohibit item selection.
Use the SelectedItem property to get or set the selected accordion item.
Refer to the Selection topic to learn more.
The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectedItem 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-accordion-customize-appearance/CS/AppearanceCustomization/MainWindow.xaml#L30
ItemsSource="{Binding Items}"
SelectedItem="{Binding SelectedItem}"
ChildrenPath="Nodes" DisplayMemberPath="Header"
wpf-accordion-bind-to-data-hierarchicaldatatemplate/CS/HierarchicalDataTemplate/MainWindow.xaml#L21
<dxa:AccordionControl x:Name="accordion" SelectionUnit="SubItem"
ItemsSource="{Binding MyData.Categories }" SelectedItem="{Binding SelectedItem}">
<dxa:AccordionControl.ItemTemplate>
wpf-accordion-bind-to-data-using-childrenpath/CS/ChildrenPath/MainWindow.xaml#L21
<dxa:AccordionControl Name="accordion" ItemsSource="{Binding AppMenu.MenuItems }"
SelectedItem="{Binding SelectedItem}"
ChildrenPath="SubItems" DisplayMemberPath="Caption"/>
<dxa:AccordionControl Name="accordion" SelectionUnit="SubItem" ItemsSource="{Binding MyData.Categories }"
SelectedItem="{Binding SelectedItem}" ChildrenSelector="{StaticResource mySelector}">
<dxa:AccordionControl.Resources>
See Also