Back to Devexpress

AutoFilterColumn.ApplyFillFilter(Fill) Method

officefileapi-devexpress-dot-spreadsheet-dot-autofiltercolumn-dot-applyfillfilter-x28-devexpress-dot-spreadsheet-dot-fill-x29.md

latest4.5 KB
Original Source

AutoFilterColumn.ApplyFillFilter(Fill) Method

Applies a filter by cell fill pattern.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void ApplyFillFilter(
    Fill fill
)
vb
Sub ApplyFillFilter(
    fill As Fill
)

Parameters

NameTypeDescription
fillFill

An object that contains fill parameters.

|

Remarks

Example

csharp
Worksheet worksheet = workbook.Worksheets["Regional sales"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Enable filtering for the "B2:E23" cell range.
CellRange range = worksheet["B2:E23"];
worksheet.AutoFilter.Apply(range);

// Filter values in the "Products" column by fill color.
AutoFilterColumn products = worksheet.AutoFilter.Columns[1];
products.ApplyFillFilter(worksheet["C10"].Fill);
vb
Dim worksheet As Worksheet = workbook.Worksheets("Regional sales")
workbook.Worksheets.ActiveWorksheet = worksheet

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

' Filter values in the "Products" column by fill color.
Dim products As AutoFilterColumn = worksheet.AutoFilter.Columns(1)
products.ApplyFillFilter(worksheet("C10").Fill)

The following code snippets (auto-collected from DevExpress Examples) contain references to the ApplyFillFilter(Fill) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

spreadsheet-document-api-examples-part2/CS/SpreadsheetDocServerAPIPart2/CodeExamples/AutoFilterActions.cs#L260

csharp
AutoFilterColumn products = worksheet.AutoFilter.Columns[1];
products.ApplyFillFilter(worksheet["C10"].Fill);
#endregion #FilterByFillColor

winforms-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_API_Part02/SpreadsheetActions/AutoFilterActions.cs#L332

csharp
AutoFilterColumn products = worksheet.AutoFilter.Columns[1];
products.ApplyFillFilter(worksheet["C10"].Fill);
#endregion #FilterByFillColor

wpf-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_WPF_API_Part02/SpreadsheetActions/AutoFilterActions.cs#L332

csharp
AutoFilterColumn products = worksheet.AutoFilter.Columns[1];
products.ApplyFillFilter(worksheet["C10"].Fill);
#endregion #FilterByFillColor

spreadsheet-document-api-examples-part2/VB/SpreadsheetDocServerAPIPart2/CodeExamples/AutoFilterActions.vb#L242

vb
Dim products As AutoFilterColumn = worksheet.AutoFilter.Columns(1)
            products.ApplyFillFilter(worksheet("C10").Fill)
' #End Region ' #FilterByFillColor

See Also

AutoFilterColumn Interface

AutoFilterColumn Members

DevExpress.Spreadsheet Namespace