AccordionControl.FilterContent Event
Allows you to control an element’s visibility during a filtration performed using the built-in filter control.
Namespace: DevExpress.XtraBars.Navigation
Assembly: DevExpress.XtraBars.v19.1.dll
Declaration
Event Data
The FilterContent event's data class is DevExpress.XtraBars.Navigation.FilterContentEventArgs.
Remarks
With the AccordionControl.ShowFilterControl property, you can enable a built-in filter control that allows end-users to filter elements by entering a search string.
Each time a search string is modified in the built-in filter control, the FilterContent event fires for each element in the AccordionControl. You can handle this event to manually control the visibility of certain elements. Use the Visible event parameter to hide the currently processed element (the Element parameter) or maintain its visibility. After setting the Visible property to the required visibility status, set the event’s Handled parameter to true. Otherwise, the default filtration mechanism will be invoked after your FilterContent event handler is complete. The default filtration mechanism may override the visibility status you have set.
The current search string can be accessed with the FilterValue event parameter.
Example
The following code handles the FilterContent event to make an element containing the “help” string always visible, regardless of the current search criteria.
private void accordionControl1_FilterContent(object sender, DevExpress.XtraBars.Navigation.FilterContentEventArgs e) {
if (e.Element.Text.ToLower() == "help") {
e.Visible = true;
e.Handled = true;
}
}