Back to Devexpress

AccordionControl.CustomItemFilter Event

wpf-devexpress-dot-xpf-dot-accordion-dot-accordioncontrol-1cd59bf0.md

latest5.9 KB
Original Source

AccordionControl.CustomItemFilter Event

Occurs when the AccordionControl is about to be filtered.

Namespace : DevExpress.Xpf.Accordion

Assembly : DevExpress.Xpf.Accordion.v25.2.dll

NuGet Package : DevExpress.Wpf.Accordion

Declaration

csharp
public event EventHandler<AccordionCustomItemFilterEventArgs> CustomItemFilter
vb
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:

PropertyDescription
AcceptedGets or sets a value indicating whether the currently processed item is included in the results.
AccordionGets the AccordionControl whose items are being filtered.
HandledGets 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.
ItemGets the currently processed Accordion item.
OriginalSourceGets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
SearchTextGets the search criteria.
SourceGets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.

The event data class exposes the following methods:

MethodDescription
InvokeEventHandler(Delegate, Object)When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation. Inherited from RoutedEventArgs.
OnSetSource(Object)When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes. Inherited from RoutedEventArgs.
PassesFilter(String)Checks whether the specified string meets filter criteria.

Remarks

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:

xaml
<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}"/>
</dxa:AccordionControl>
csharp
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

AccordionControl Class

AccordionControl Members

DevExpress.Xpf.Accordion Namespace