Enum FilterOperatorType

FilterOperatorType enumeration

Custom Filter operator type.

public enum FilterOperatorType

Values

NameValueDescription
LessOrEqual0Represents LessOrEqual operator.
LessThan1Represents LessThan operator.
Equal2Represents Equal operator.
GreaterThan3Represents GreaterThan operator.
NotEqual4Represents NotEqual operator.
GreaterOrEqual5Represents GreaterOrEqual operator.
None6Represents no comparison.
BeginsWith7Begins with the text.
EndsWith8Ends with the text.
Contains9Contains the text.
NotContains10Not contains the text.
NotBeginsWith11Not begins with the text.
NotEndsWith12Not ends with the text.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class CellsClassFilterOperatorTypeDemo
    {
        public static void Run()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            
            // Access the first worksheet
            Worksheet worksheet = workbook.Worksheets[0];
            
            // Add sample data
            worksheet.Cells["A1"].PutValue("Names");
            worksheet.Cells["A2"].PutValue("Bob");
            worksheet.Cells["A3"].PutValue("Alice");
            worksheet.Cells["A4"].PutValue("Bobby");
            worksheet.Cells["A5"].PutValue("Tom");
            
            // Set auto filter range
            worksheet.AutoFilter.Range = "A1:A5";
            
            // Apply custom filter to show names beginning with "Bo"
            worksheet.AutoFilter.Custom(0, FilterOperatorType.BeginsWith, "Bo");
            
            // Refresh the filter
            worksheet.AutoFilter.Refresh();
            
            // Save the workbook
            workbook.Save("FilterOperatorTypeDemo.xlsx", SaveFormat.Xlsx);
        }
    }
}

See Also