Back to Devexpress

FilterValue.Values Property

officefileapi-devexpress-dot-spreadsheet-dot-filtervalue-cd21bb81.md

latest3.1 KB
Original Source

FilterValue.Values Property

Gets an array of strings that corresponds to the cell values by which a filtering is performed.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public string[] Values { get; }
vb
Public ReadOnly Property Values As String()

Property Value

TypeDescription
String[]

A String[] object that is the array of string values which are the filter criteria.

|

Remarks

The AutoFilterColumn.ApplyFilterCriteria method gets an object or an array of CellValue objects as a parameter. The method creates a FilterCriteria object whose FilterCriteria.Filters property provides access to the FilterValue object with the Values property containing an array of strings to which the passed parameter has been converted.

The code snippet below illustrates the use of the ApplyFilterCriteria method.

View Example

vb
' Enable filtering for the specified cell range.
Dim range As CellRange = worksheet("B2:E23")
worksheet.AutoFilter.Apply(range)

' Filter the data in the "Product" column by an array of values.
worksheet.AutoFilter.Columns(1).ApplyFilterCriteria(New CellValue() { "Mozzarella di Giovanni", "Gorgonzola Telino"})
csharp
// Enable filtering for the specified cell range.
CellRange range = worksheet["B2:E23"];
worksheet.AutoFilter.Apply(range);

// Filter the data in the "Product" column by an array of values.
worksheet.AutoFilter.Columns[1].ApplyFilterCriteria(new CellValue[] { "Mozzarella di Giovanni", "Gorgonzola Telino"});

This code results in the following Values value:

The AutoFilter dialog displays the resulting filter as shown in the picture below.

See Also

FilterValue Class

FilterValue Members

DevExpress.Spreadsheet Namespace