All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

GridView.CustomizationFormSearch Event

Allows you to filter search results when a user searches in the Customization Form.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v20.2.dll

Declaration

[DXCategory("Action")]
public event CustomizationFormSearchEventHandler CustomizationFormSearch
<DXCategory("Action")>
Public Event CustomizationFormSearch As CustomizationFormSearchEventHandler

Event Data

The CustomizationFormSearch event's data class is CustomizationFormSearchEventArgs. The following properties provide information specific to this event:

Property Description
Band Gets the currently processed band. Returns null if the CustomizationFormSearch event is fired for a column.
Caption Gets the caption of the currently processed column or band.
Column Gets the currently processed column. Returns null if the CustomizationFormSearch event is fired for a band.
OwnerBand Gets the band that owns the current column or band. Returns null if there is no band for the current column/band.
OwnerBandCaption Gets the caption of the OwnerBand object. Returns an empty string if the OwnerBand object is null.
SearchText Gets the search string.
Visible Gets or sets the visibility of the currently processed column or band.

Remarks

The Customization Form's search box allows users to locate columns and bands by their captions.

The default search algorithm locates columns/bands that contain the search string in their display captions. If a banded grid column matches the search string, it is displayed along with its owner band.

Handle the CustomizationFormSearch event to change the search logic. This event fires for each item (column or band) displayed in the Customization Form on each change to the search text.

Example

The following example handles the CustomizationFormSearch event to show a band's children in the Customization Form when this band matches the search string.

void CustomizationFormSearch(object sender, CustomizationFormSearchEventArgs e) {
    if(e.OwnerBandCaption.Contains(e.SearchText))
        e.Visible = true;
}
NOTE

The Data Grid silently suppresses any exception raised in your CustomizationFormSearch event handler.

See Also