AccordionControl.FilterContent Event
Fires when the query in the search box is changed and allows you to show or hide an element regardless of the query.
Namespace: DevExpress.XtraBars.Navigation
Assembly: DevExpress.XtraBars.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
Event Data
The FilterContent event's data class is DevExpress.XtraBars.Navigation.FilterContentEventArgs.
Remarks
The ShowFilterControl property allows you to enable the built-in search box. The control filters elements according to the query in the search box. The FilterContent
event fires when the query is changed and allows you to show or hide an element regardless of the query.
The FilterValue event argument returns the query. Use the Element argument to get the currently processed element and the Visible argument to set whether the element is shown or hidden. The Handled event argument should be set to true for the event handler to be in effect.
Example
The code below shows how to handle the FilterContent
event to always show Help regardless of the search query.
private void accordionControl1_FilterContent(object sender, DevExpress.XtraBars.Navigation.FilterContentEventArgs e) {
if (e.Element.Text.ToLower() == "help") {
e.Visible = true;
e.Handled = true;
}
}