Syncfusion.XlsIO.Base
Example 


FilteredItems Property

Returns filter values for combination type ( Text and DateTime) and dynamic type. It returns null, if custom filter is applied. Read-only.
Syntax
'Declaration
 
ReadOnly Property FilteredItems As IFilter
'Usage
 
Dim instance As IAutoFilter
Dim value As IFilter
 
value = instance.FilteredItems
IFilter FilteredItems {get;}
Example
The following code illustrates how to access the applied filter using FilteredItems property.
using Syncfusion.XlsIO;
using System;
using System.Drawing;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Apply colors
            worksheet["A2:A3"].CellStyle.Color = Color.Red;
            worksheet["A4:A5"].CellStyle.Color = Color.Blue;
            worksheet["A6:A7"].CellStyle.Color = Color.Green;
            
            //Create filters collection
            IAutoFilters filters = worksheet.AutoFilters;
            
            //Set range
            filters.FilterRange = worksheet["A1:A7"];
            
            //Set filter column
            IAutoFilter filter = filters[0];
            
            //Add filter
            filter.AddColorFilter(Color.Blue, ExcelColorFilterType.CellColor);
            
            //Get filtered items
            Console.WriteLine(filter.FilteredItems.FilterType.ToString());
            
            //Apply AutoFit
            worksheet.UsedRange.AutofitColumns();
            
            //Save and Dispose
            workbook.SaveAs("Filters.xlsx");
            workbook.Close();
            Console.ReadKey();
        }
    }
}
//Output will be
//ColorFilter
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also