Class AutoFiltersCollection
Represents an AutoFilter collections
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation.Collections
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class AutoFiltersCollection : CollectionBaseEx<object>, IList<object>, ICollection<object>, IEnumerable<object>, IEnumerable, ICloneParent, IAutoFilters, IParentApplication
Constructors
AutoFiltersCollection(IApplication, Object)
Creates a new instance for AutoFilter collection.
Declaration
public AutoFiltersCollection(IApplication application, object parent)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Excelengine application. |
System.Object | parent | Parent object. |
Fields
DEF_AUTOFILTER_NAMEDRANGE
Name of the named range for autofilter range.
Declaration
public const string DEF_AUTOFILTER_NAMEDRANGE = "_FilterDatabase"
Field Value
Type |
---|
System.String |
DEF_EXCEL07_AUTOFILTER_NAMEDRANGE
Name of the named range for autofilter range in MS Excel 2007.
Declaration
public const string DEF_EXCEL07_AUTOFILTER_NAMEDRANGE = "_xlnm._FilterDatabase"
Field Value
Type |
---|
System.String |
Properties
AddressR1C1
Gets address of filtered range in R1C1 style. Read-only.
Declaration
public string AddressR1C1 { get; }
Property Value
Type |
---|
System.String |
DataSorter
Gets the DataSorter.
Declaration
public IDataSort DataSorter { get; }
Property Value
Type | Description |
---|---|
IDataSort | The DataSorter. |
Examples
The following code illustrates how to get the DataSorter from AutoFilters.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Open("Sorting.xlsx");
workbook.Worksheets[0].AutoFilters.FilterRange = workbook.Worksheets[0].UsedRange;
//Create DataSorter for AutoFilters.
IDataSort filterSort = workbook.Worksheets[0].AutoFilters.DataSorter;;
//Adding Sorting fields for DataSorter.
filterSort.SortFields.Add(1, SortOn.Values, OrderBy.Ascending);
//Perform Sorting for AutoFilters.
filterSort.Sort();
workbook.SaveAs("SortedExcel.xlsx");
workbook.Close();
excelEngine.Dispose();
DefaultNamedRangeName
Gets default autofilter named range name.
Declaration
public string DefaultNamedRangeName { get; }
Property Value
Type |
---|
System.String |
FilterRange
Range to be filtered.
Declaration
public IRange FilterRange { get; set; }
Property Value
Type |
---|
IRange |
IsFiltered
Indicates whether sheet contains filtered range.
Declaration
public bool IsFiltered { get; }
Property Value
Type |
---|
System.Boolean |
Item[Int32]
Returns single autofilter object by column index. Read-only.
Declaration
public IAutoFilter this[int columnIndex] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | columnIndex |
Property Value
Type |
---|
IAutoFilter |
Worksheet
Returns parent worksheet. Read-only.
Declaration
public WorksheetImpl Worksheet { get; }
Property Value
Type |
---|
WorksheetImpl |
Methods
ChangeVersions(Int32, Int32, ExcelVersion)
Changes Excel versions based on AutoFilter collection.
Declaration
public void ChangeVersions(int iLastRow, int iLastColumn, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iLastRow | Max last row. |
System.Int32 | iLastColumn | Max last column. |
ExcelVersion | version | Excel version to make conversion into. |
Clone(WorksheetImpl)
Clones AutoFilter collection.
Declaration
public AutoFiltersCollection Clone(WorksheetImpl parent)
Parameters
Type | Name | Description |
---|---|---|
WorksheetImpl | parent | Parent object. |
Returns
Type | Description |
---|---|
AutoFiltersCollection | Returns cloned object. |
Parse(List<BiffRecordRaw>)
Parses filter records. Must be called after parsing of all names.
Declaration
public void Parse(List<BiffRecordRaw> records)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw> | records | Records to parse |
Serialize(OffsetArrayList)
Serializes AutoFilter collection into set of records.
Declaration
public void Serialize(OffsetArrayList records)
Parameters
Type | Name | Description |
---|---|---|
OffsetArrayList | records | Place where serialized records will be placed. |
UpdateFilterRange()
Updates internal range object that stores filtered range.
Declaration
public void UpdateFilterRange()