Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Events")]
public event FilterContentEventHandler FilterContent

#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;
    }
}
See Also