Skip to main content

VGridControl.CustomRecordFilter Event

Allows you to hide a record regardless of the applied filter.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v23.2.dll

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

Declaration

public event CustomRecordFilterEventHandler CustomRecordFilter

Event Data

The CustomRecordFilter event's data class is DevExpress.XtraVerticalGrid.Events.CustomRecordFilterEventArgs.

Remarks

The CustomRecordFilter event fires when a new filter is applied. The event allows you to hide a record regardless of the applied filter.

Read the RecordIndex event parameter to get the processed record’s zero-based index in the underlying data source. The IsFitDefaultFilter parameter returns whether the record fits the applied filter. Set the Handled parameter to true to hide the record.

The code snippet below shows how to hide all records where City row contains Berlin.

private void vGridControl1_CustomRecordFilter(object sender, DevExpress.XtraVerticalGrid.Events.CustomRecordFilterEventArgs e) {
    DevExpress.XtraVerticalGrid.VGridControl grid = sender as DevExpress.XtraVerticalGrid.VGridControl;
    if (sender == null) return;
    DataRowView dataRowView = grid.GetRecordObject(e.RecordIndex) as DataRowView;
    if (dataRowView == null) return;
    if (dataRowView.Row["City"] as String == "Berlin") e.Handled = true;         
}
See Also