windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrol-c3fec00b.md
Provides access to the collection of filters applied to particular rows, and the overall filter.
Namespace : DevExpress.XtraVerticalGrid
Assembly : DevExpress.XtraVerticalGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
[XtraSerializableProperty(XtraSerializationVisibility.Hidden)]
[DXCategory("Behavior")]
public VGridFilter ActiveFilter { get; }
<XtraSerializableProperty(XtraSerializationVisibility.Hidden)>
<DXCategory("Behavior")>
Public ReadOnly Property ActiveFilter As VGridFilter
| Type | Description |
|---|---|
| DevExpress.XtraVerticalGrid.VGridFilter |
A DevExpress.XtraVerticalGrid.VGridFilter object representing the collection of filters applied to the rows.
|
The ActiveFilter property of the DevExpress.XtraVerticalGrid.VGridFilter type provides a number of properties which can be used to get details on the filter criteria applied to the grid rows:
the indexer allows you to obtain the filter criterion for a particular row. You can also iterate through the collection using the zero-based index;
the ActiveFilter.Criteria property gets the overall filter criterion which is a conjunction of filters for all rows. The VGridControl.ActiveFilterCriteria property is equivalent to the ActiveFilter.Criteria property;
the ActiveFilter.Expression property returns the textual representation of the overall filter criteria, which is displayed in the control’s filter panel. The VGridControl.ActiveFilterString property is equivalent to the ActiveFilter.Expression property.
the NonRowFilterCriteria property gets or sets a filter which is applied, but not associated with a particular row using the RowProperties.FilterInfo property;
the Changed event fires when a row filter changes.
To temporarily disable/enable the filter criteria, use the VGridControl.ActiveFilterEnabled property.
The following code shows how to add a filter condition to the control using the VGridControl.ActiveFilter property. The filter condition selects records whose City field starts with ‘S’.
using DevExpress.XtraVerticalGrid.Rows;
// ...
vGridControl1.ActiveFilter.Add(vGridControl1.GetRowPropertiesByFieldName("City"), new VGridRowFilterInfo("[City] Like 'S%'"));
Imports DevExpress.XtraVerticalGrid.Rows
' ...
vGridControl1.ActiveFilter.Add(vGridControl1.GetRowPropertiesByFieldName("City"), New VGridRowFilterInfo("[City] Like 'S%'"))
See Also