VGridControl.CustomRecordFilter Event
Allows you to hide a particular record regardless of the applied data filter.
Namespace: DevExpress.XtraVerticalGrid
Assembly: DevExpress.XtraVerticalGrid.v18.2.dll
Declaration
Event Data
The CustomRecordFilter event's data class is DevExpress.XtraVerticalGrid.Events.CustomRecordFilterEventArgs.
Remarks
The CustomRecordFilter event fires for each record in the vertical grid when a new data filter is applied (see VGridControl.FilterRecords), allowing you to customize whether the record should be hidden, regardless of the applied data filter. Read the RecordIndex event parameter to get the zero-based index of the record being processed 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 the City row contains ‘Berlin’ regardless of the applied filter.
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;
}