Back to Devexpress

AutoFilterBase.ReApply() Method

officefileapi-devexpress-dot-spreadsheet-dot-autofilterbase-0687cac0.md

latest5.2 KB
Original Source

AutoFilterBase.ReApply() Method

Reapplies a filter.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void ReApply()
vb
Sub ReApply

Remarks

Use the ReApply method to reapply a filter after the data in the filtered range has been changed.

Example

View Example

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

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

// Filter values in the "Sales" column that are greater than 5000$.
worksheet.AutoFilter.Columns[2].ApplyCustomFilter(5000, FilterComparisonOperator.GreaterThan);

// Change the data and reapply the filter.
worksheet["D3"].Value = 5000;
worksheet.AutoFilter.ReApply();
vb
Dim worksheet As Worksheet = workbook.Worksheets("Regional sales")
workbook.Worksheets.ActiveWorksheet = worksheet

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

' Filter values in the "Sales" column that are greater than 5000$.
worksheet.AutoFilter.Columns(2).ApplyCustomFilter(5000, FilterComparisonOperator.GreaterThan)

' Change the data and reapply the filter.
worksheet("D3").Value = 5000
worksheet.AutoFilter.ReApply()

The following code snippets (auto-collected from DevExpress Examples) contain references to the ReApply() 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.

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

csharp
worksheet["D3"].Value = 5000;
worksheet.AutoFilter.ReApply();
#endregion #ReapplyFilter

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

csharp
worksheet["D3"].Value = 5000;
worksheet.AutoFilter.ReApply();
#endregion #ReapplyFilter

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

csharp
worksheet["D3"].Value = 5000;
worksheet.AutoFilter.ReApply();
#endregion #ReapplyFilter

winforms-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_API_Part02/SpreadsheetActions/AutoFilterActions.vb#L270

vb
worksheet("D3").Value = 5000
                worksheet.AutoFilter.ReApply()
' #End Region ' #ReapplyFilter

wpf-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_WPF_API_Part02/SpreadsheetActions/AutoFilterActions.vb#L269

vb
worksheet("D3").Value = 5000
                worksheet.AutoFilter.ReApply()
' #End Region ' #ReapplyFilter

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

vb
worksheet("D3").Value = 5000
            worksheet.AutoFilter.ReApply()
' #End Region ' #ReapplyFilter

See Also

AutoFilterBase Interface

AutoFilterBase Members

DevExpress.Spreadsheet Namespace