AccordionControl.CustomItemFilter Event
In This Article
Occurs when the AccordionControl is about to be filtered.
Namespace: DevExpress.Xpf.Accordion
Assembly: DevExpress.Xpf.Accordion.v24.2.dll
NuGet Package: DevExpress.Wpf.Accordion
#Declaration
public event EventHandler<AccordionCustomItemFilterEventArgs> CustomItemFilter
#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 Accordion |
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 Routed |
Item | Gets the currently processed Accordion item. |
Original |
Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.
Inherited from Routed |
Routed |
Gets or sets the Routed |
Search |
Gets the search criteria. |
Source |
Gets or sets a reference to the object that raised the event.
Inherited from Routed |
The event data class exposes the following methods:
Method | Description |
---|---|
Invoke |
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 Routed |
On |
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 Routed |
Passes |
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:
<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>
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