[]
        
(Showing Draft Content)

GrapeCity.Spreadsheet.IRange.AutoFilter

AutoFilter Method

AutoFilter(bool, bool)

Creates the automatic filter for current selection if the filter doesn't exist; otherwise, remove the filter.

Declaration
bool AutoFilter(bool columnFilter = false, bool initColumns = true)
Function AutoFilter(Optional columnFilter As Boolean = False, Optional initColumns As Boolean = True) As Boolean
Parameters
Type Name Description
bool columnFilter

A boolean value indicating whether the IAutoFilter is column filter. The default value is false.

bool initColumns

A boolean value indicating whether the IAutoFilteris init the default column filter when columnFilter is true

Returns
Type Description
bool

true if has changed; otherwise, false.

AutoFilter(int, Fill)

Add the cell fill color filter.

Declaration
bool AutoFilter(int columnIndex, Fill fillColor)
Function AutoFilter(columnIndex As Integer, fillColor As Fill) As Boolean
Parameters
Type Name Description
int columnIndex

Index of the column.

Fill fillColor

Color of the fill.

Returns
Type Description
bool

true if has changed; otherwise, false.

AutoFilter(int, Color)

Add the font color filter.

Declaration
bool AutoFilter(int columnIndex, Color color)
Function AutoFilter(columnIndex As Integer, color As Color) As Boolean
Parameters
Type Name Description
int columnIndex

Index of the column.

Color color

Color of the font.

Returns
Type Description
bool

true if has changed; otherwise, false.

AutoFilter(int, DynamicFilterType)

Add the dynamic filter.

Declaration
bool AutoFilter(int columnIndex, DynamicFilterType dynamicType)
Function AutoFilter(columnIndex As Integer, dynamicType As DynamicFilterType) As Boolean
Parameters
Type Name Description
int columnIndex

Index of the column.

DynamicFilterType dynamicType

A DynamicFilterType value indicates the dynamic filter type.

Returns
Type Description
bool

true if has changed; otherwise, false.

AutoFilter(int, CfIcon)

Add the icon filter.

Declaration
bool AutoFilter(int columnIndex, CfIcon icon)
Function AutoFilter(columnIndex As Integer, icon As CfIcon) As Boolean
Parameters
Type Name Description
int columnIndex

Index of the column.

CfIcon icon

A CfIcon value represents the icon which is used to filter.

Returns
Type Description
bool

true if has changed; otherwise, false.

AutoFilter(int, object, AutoFilterOperator, object)

Filters a list using the AutoFilter.

Declaration
bool AutoFilter(int columnIndex, object criteria1 = null, AutoFilterOperator filterOperator = AutoFilterOperator.And, object criteria2 = null)
Function AutoFilter(columnIndex As Integer, Optional criteria1 As Object = Nothing, Optional filterOperator As AutoFilterOperator = AutoFilterOperator.And, Optional criteria2 As Object = Nothing) As Boolean
Parameters
Type Name Description
int columnIndex

Index of the column.

object criteria1

The first criteria is corresponding the first filter criteria.

AutoFilterOperator filterOperator

The value specifying the type of filter.

object criteria2

The second criteria is corresponding the second filter criteria.

Returns
Type Description
bool

true if has changed; otherwise, false.

Remarks

If filterOperator is FilterValues, criteria1 can be string[] or DateGroupItem[] array.