Back to Devexpress

VGridControl.ActiveFilter Property

windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrol-c3fec00b.md

latest3.9 KB
Original Source

VGridControl.ActiveFilter Property

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

Declaration

csharp
[XtraSerializableProperty(XtraSerializationVisibility.Hidden)]
[DXCategory("Behavior")]
public VGridFilter ActiveFilter { get; }
vb
<XtraSerializableProperty(XtraSerializationVisibility.Hidden)>
<DXCategory("Behavior")>
Public ReadOnly Property ActiveFilter As VGridFilter

Property Value

TypeDescription
DevExpress.XtraVerticalGrid.VGridFilter

A DevExpress.XtraVerticalGrid.VGridFilter object representing the collection of filters applied to the rows.

|

Remarks

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.

Example

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’.

csharp
using DevExpress.XtraVerticalGrid.Rows;
// ...
vGridControl1.ActiveFilter.Add(vGridControl1.GetRowPropertiesByFieldName("City"), new VGridRowFilterInfo("[City] Like 'S%'"));
vb
Imports DevExpress.XtraVerticalGrid.Rows
' ...
vGridControl1.ActiveFilter.Add(vGridControl1.GetRowPropertiesByFieldName("City"), New VGridRowFilterInfo("[City] Like 'S%'"))

See Also

ActiveFilterString

ActiveFilterCriteria

FilterInfo

VGridControl Class

VGridControl Members

DevExpress.XtraVerticalGrid Namespace