Back to Devexpress

Children Selector

wpf-119809-controls-and-libraries-navigation-controls-accordion-control-data-binding-children-selector.md

latest1.6 KB
Original Source

Children Selector

  • Jun 07, 2019
  • 2 minutes to read

This topic describes how to bind the AccordionControl to data if your data source contains objects of different types.

The table below shows the required properties:

MemberDescription
AccordionControl.ItemsSourceSpecifies the path to a collection of accordion items.
AccordionControl.ChildrenSelectorAllows choosing the item’s children based on custom logic.

Complete the following steps to configure the binding:

  1. Specify the AccordionControl.ItemsSource property to bind the AccordionControl to data:

  2. Create a class that implements the IChildrenSelector interface and assign its instance to the AccordionControl.ChildrenSelector property:

  3. Create a data template for each data source type to display the required information in accordion item headers:

The image below shows the result:

Example