AccordionControl.CustomItemFilter Event

Occurs when the AccordionControl is about to be filtered.

Namespace: DevExpress.Xpf.Accordion

Assembly: DevExpress.Xpf.Accordion.v20.1.dll


public event EventHandler<AccordionCustomItemFilterEventArgs> CustomItemFilter
Public Event CustomItemFilter As EventHandler(Of AccordionCustomItemFilterEventArgs)

Event Data

The CustomItemFilter event's data class is AccordionCustomItemFilterEventArgs. The following properties provide information specific to this event:

Property Description
Accepted Gets or sets a value indicating whether the currently processed item is included in the results.
Accordion Gets the AccordionControl whose items are being filtered.
Handled Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. Inherited from RoutedEventArgs.
Item Gets the currently processed Accordion item.
OriginalSource Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
RoutedEvent Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
SearchText Gets the search criteria.
Source Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.


You can handle the CustomItemFilter event to customize the AccordionControl's filtering logic.

The following code sample shows how to exclude an accordion item from the search result:

<dxa:AccordionControl ShowSearchControl="True" CustomItemFilter="OnCustomItemFilter">
   <dxa:AccordionItem Header="Item1" Glyph="{dx:DXImage Image=Image_32x32.png}"/>
   <dxa:AccordionItem Header="Item2" Glyph="{dx:DXImage Image=Map_32x32.png}"/>
   <dxa:AccordionItem Header="Item3" Glyph="{dx:DXImage Image=Image_32x32.png}"/>
void OnCustomItemFilter(object sender, AccordionCustomItemFilterEventArgs e) {
   if(((AccordionItem)e.Item).Header.ToString() == "Item1") {
      e.Accepted = false;

The image below shows the result:


Refer to the Searching topic to learn more.

See Also