GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    FilterColumn Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Represents filter and sort settings for a single filter column.

    • C#
    • VB.NET
    public sealed class FilterColumn
    Public NotInheritable Class FilterColumn
    Inheritance:
    System.Object
    FilterColumn

    Properties

    Filter

    Gets the filter settings applied to this column or null if no filter settings are applied to this column.

    • C#
    • VB.NET
    public Filter Filter { get; }
    Public ReadOnly Property Filter As Filter
    Property Value
    Filter

    The filter settings applied to this column or null if no filter settings are applied to this column.

    HiddenAutoButton

    Gets or sets a value indicating whether the AutoFilter button for this column is hidden.

    Default value is false.

    • C#
    • VB.NET
    public bool HiddenAutoButton { get; set; }
    Public Property HiddenAutoButton As Boolean
    Property Value
    System.Boolean

    true if the AutoFilter button for this column is hidden; otherwise, false.

    Index

    Gets the column index relative to the Range that this column filter applies to.

    Value is equal to or greater than zero and less than Width of the Range.

    • C#
    • VB.NET
    public int Index { get; }
    Public ReadOnly Property Index As Integer
    Property Value
    System.Int32

    The column index relative to the Range that this filter column applies to.

    Match

    Gets or sets the method that defines a set of criteria and determines whether the specified ExcelCell meets those criteria.

    Default value is default method based on the settings of this filter.

    • C#
    • VB.NET
    public Predicate<ExcelCell> Match { get; set; }
    Public Property Match As Predicate(Of ExcelCell)
    Property Value
    System.Predicate<ExcelCell>

    The method that defines a set of criteria and determines whether the specified ExcelCell meets those criteria.

    Remarks

    Use this property to override default method that is based on the settings of this filter.

    This member is not loaded from and saved to XLSX file since it is not supported by Office Open XML specification. It is used to customize GemBox.Spreadsheet functionality.

    If set to null, reverts to default method based on the settings of this filter.

    ShowButton

    Gets or sets a value indicating whether the filter button is visible.

    For example, when the cell containing the filter button is merged with another cell, the filter button may be hidden, and not drawn.

    Default value is true.

    • C#
    • VB.NET
    public bool ShowButton { get; set; }
    Public Property ShowButton As Boolean
    Property Value
    System.Boolean

    true if the filter button is visible; otherwise, false.

    Sort

    Gets the sort settings applied to this column or null if no sort settings are applied to this column.

    • C#
    • VB.NET
    public SortLevel Sort { get; }
    Public ReadOnly Property Sort As SortLevel
    Property Value
    SortLevel

    The sort settings applied to this column or null if no sort settings are applied to this column.

    Methods

    AddSort()

    Adds a SortLevel to this column.

    Previous sort levels are maintained. If this FilterColumn already specifies a sort level (Sort is not equal to null) it will be removed before a new one is added.

    Use members of a returned SortLevel to specify sort settings.

    • C#
    • VB.NET
    public SortLevel AddSort()
    Public Function AddSort As SortLevel
    Returns
    SortLevel

    A SortLevel.

    ClearFilter()

    Clears the filter from this FilterColumn.

    • C#
    • VB.NET
    public void ClearFilter()
    Public Sub ClearFilter

    ClearSort()

    Clears the sort level from this FilterColumn.

    • C#
    • VB.NET
    public void ClearSort()
    Public Sub ClearSort

    SetCustomFilter()

    Sets a CustomFilter to this column.

    CustomFilter filters by a one or two conditions (operators and values).

    Use members of a returned CustomFilter to specify filter settings.

    • C#
    • VB.NET
    public CustomFilter SetCustomFilter()
    Public Function SetCustomFilter As CustomFilter
    Returns
    CustomFilter

    A CustomFilter.

    Remarks

    If this FilterColumn already specifies a filter (Filter is not equal to null), it will be overridden.

    SetDynamicFilter()

    Sets a DynamicFilter to this column.

    DynamicFilter filters by a dynamic criteria that can change, either with the data itself (e.g., "above average") or with the current system date (e.g., show values for "today").

    Use members of a returned DynamicFilter to specify filter settings.

    • C#
    • VB.NET
    public DynamicFilter SetDynamicFilter()
    Public Function SetDynamicFilter As DynamicFilter
    Returns
    DynamicFilter

    A DynamicFilter.

    Remarks

    If this FilterColumn already specifies a filter (Filter is not equal to null), it will be overridden.

    SetSort()

    Sets a SortLevel to this column.

    All other sort levels are cleared.

    Use members of a returned SortLevel to specify sort settings.

    • C#
    • VB.NET
    public SortLevel SetSort()
    Public Function SetSort As SortLevel
    Returns
    SortLevel

    A SortLevel.

    SetTop10Filter()

    Sets a Top10Filter to this column.

    Top10Filter filters by a top N (percent or number of items).

    Use members of a returned Top10Filter to specify filter settings.

    • C#
    • VB.NET
    public Top10Filter SetTop10Filter()
    Public Function SetTop10Filter As Top10Filter
    Returns
    Top10Filter

    A Top10Filter.

    Remarks

    If this FilterColumn already specifies a filter (Filter is not equal to null), it will be overridden.

    SetValuesFilter()

    Sets a ValuesFilter to this column.

    ValuesFilter filters by a list of values.

    Use members of a returned ValuesFilter to specify filter settings.

    • C#
    • VB.NET
    public ValuesFilter SetValuesFilter()
    Public Function SetValuesFilter As ValuesFilter
    Returns
    ValuesFilter

    A ValuesFilter.

    Remarks

    If this FilterColumn already specifies a filter (Filter is not equal to null), it will be overridden.

    ToString()

    Returns a System.String that represents this FilterColumn instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this FilterColumn instance.

    Overrides
    System.Object.ToString()
    Remarks

    This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.