Back to Devexpress

VGridControlBase.CustomizationFormSearch Event

windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrolbase-aa839377.md

latest3.4 KB
Original Source

VGridControlBase.CustomizationFormSearch Event

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

Namespace : DevExpress.XtraVerticalGrid

Assembly : DevExpress.XtraVerticalGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

Declaration

csharp
[DXCategory("Action")]
public event CustomizationFormSearchEventHandler CustomizationFormSearch
vb
<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:

PropertyDescription
CaptionGets the caption of the processed row or category.
RowGets the processed row.
SearchTextGets the search string.
VisibleGets or sets the visibility of the processed row or category.

Remarks

The Customization Form search box allows users to locate rows and categories by their captions.

The default search algorithm locates rows/categories that contain the search string in their captions. If a row caption matches the search string, this row is displayed with its owner category.

Handle the CustomizationFormSearch event to change the search logic. The VGridControl raises this event for each item (row or category) displayed in the Customization Form on each change to the search string.

Example

The following example handles the CustomizationFormSearch event to change the Contains comparison operator to StartsWith:

csharp
vGridControl.CustomizationFormSearch += (s, e) => {
    e.Visible = e.Caption.StartsWith(e.SearchText, StringComparison.OrdinalIgnoreCase);
};
vb
vGridControl.CustomizationFormSearch += Function(s, e)
    e.Visible = e.Caption.StartsWith(e.SearchText, StringComparison.OrdinalIgnoreCase)
End Function

See Also

VGridControlBase Class

VGridControlBase Members

DevExpress.XtraVerticalGrid Namespace