Back to Devexpress

AccordionControl.FilterContent Event

windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-accordioncontrol-3de4fb29.md

latest2.7 KB
Original Source

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

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event FilterContentEventHandler FilterContent
vb
<DXCategory("Events")>
Public Event FilterContent As FilterContentEventHandler

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.

csharp
private void accordionControl1_FilterContent(object sender, DevExpress.XtraBars.Navigation.FilterContentEventArgs e) {
    if (e.Element.Text.ToLower() == "help") {
        e.Visible = true;
        e.Handled = true;
    }
}
vb
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

ShowFilterControl

AccordionControl Class

AccordionControl Members

DevExpress.XtraBars.Navigation Namespace