windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-accordioncontrol-3de4fb29.md
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.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXCategory("Events")]
public event FilterContentEventHandler FilterContent
<DXCategory("Events")>
Public Event FilterContent As FilterContentEventHandler
The FilterContent event's data class is DevExpress.XtraBars.Navigation.FilterContentEventArgs.
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.
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;
}
}
Private Sub AccordionControl1_FilterContent(sender As Object, e As DevExpress.XtraBars.Navigation.FilterContentEventArgs) _
Handles AccordionControl1.FilterContent
If e.Element.Text.ToLower() = "help" Then
e.Visible = True
e.Handled = True
End If
End Sub
See Also