Back to Devexpress

AutoFilterBase.Disable() Method

officefileapi-devexpress-dot-spreadsheet-dot-autofilterbase-5982c491.md

latest5.1 KB
Original Source

AutoFilterBase.Disable() Method

Turns off the filtering functionality.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void Disable()
vb
Sub Disable

Remarks

Call the Disable method to disable the filtering functionality for a worksheet or table. In this case, the drop-down arrows will disappear from the column headers and all the specified filters will be removed.

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);

// Disable filtering for the entire worksheet.
worksheet.AutoFilter.Disable();
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)

' Disable filtering for the entire worksheet.
worksheet.AutoFilter.Disable()

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

csharp
// Disable filtering for the entire worksheet.
worksheet.AutoFilter.Disable();
#endregion #DisableFilter

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

csharp
// Disable filtering for the entire worksheet.
worksheet.AutoFilter.Disable();
#endregion #DisableFilter

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

csharp
// Disable filtering for the entire worksheet.
worksheet.AutoFilter.Disable();
#endregion #DisableFilter

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

vb
' Disable filtering for the entire worksheet.
                worksheet.AutoFilter.Disable()
' #End Region ' #DisableFilter

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

vb
' Disable filtering for the entire worksheet.
                worksheet.AutoFilter.Disable()
' #End Region ' #DisableFilter

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

vb
' Disable filtering for the entire worksheet.
            worksheet.AutoFilter.Disable()
' #End Region ' #DisableFilter

See Also

AutoFilterBase Interface

AutoFilterBase Members

DevExpress.Spreadsheet Namespace