[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Collapse]Navigation Controls
   [Collapse]Accordion Control
     Getting Started
    [Expand]Accordion Items
    [Expand]Data Binding
     Expanding and Collapsing
     Searching
     Selection
     View Mode
     Collapse Mode
    [Expand]Visual Elements
    [Expand]Examples
   [Expand]Breadcrumb Control
   [Expand]Navigation Bar
    Office Navigation Bar
    TileNav Pane
    Tile Bar
   [Expand]Wizard Control
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Expanding and Collapsing

You can expand and collapse accordion items that contain nested items. The following image shows an expandable accordion item:

This topic contains the following sections:

Expanded Expanding and Collapsing in Code

Use the following methods to expand or collapse accordion items in code:

Method Description
AccordionControl.ExpandItem Expands an accordion item.
AccordionControl.ExpandAll Expands all Accordion Items that can be expanded.
AccordionControl.CollapseItem Collapses an accordion item.
AccordionControl.CollapseAll Collapses all Accordion Items that can be collapsed.

Expanded Expanding and Collapsing at Runtime

To expand or collapse accordion item at runtime:

You can set the AccordionControl.ExpandItemOnHeaderClick property to false to prohibit expanding when clicking an item.

Expanded Expand-Collapse Button Position

Use the following properties to hide the Expand-Collapse Button or change its position:

Property Description
AccordionItem.ExpandButtonPosition Specifies the Expand-Collapse Button's position for the current accordion item.
AccordionControl.RootItemExpandButtonPosition Specifies the Expand-Collapse Button's position for all root items.
AccordionControl.SubItemExpandButtonPosition Specifies the Expand-Collapse Button's position for all subitems.

The code sample below demonstrates how to show the expand-collapse button at root items' left side:

The image below shows the result:

Expanded Expanding Modes

The AccordionControl supports different expanding modes. Use the AccordionControl.ExpandMode property to specify the mode:

Mode Description
ExpandMode.Multiple End-users can expand multiple items. At least one item is always expanded.
ExpandMode.MultipleOrNone End-users can expand multiple items. Collapsing all items is also possible.
ExpandMode.Single One accordion item is always expanded. End-users cannot collapse the expanded item.
ExpandMode.SingleOrNone End-users can expand one accordion item at a time. Collapsing all items is also possible.

The following code sample demonstrates the AccordionControl in Single expanding mode:

The image below shows the result:

Expanded Expanding and Collapsing Animation

The AccordionControl applies an animation when expanding or collapsing accordion items, by default. You can disable the animation by:

Is this topic helpful?​​​​​​​