Spread Windows Forms 6.0 Product Documentation
AutoFilterColumn Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : AutoFilterColumn Method

Column index
Filter string
Filter item index

Glossary Item Box

Automatically filters the rows in the specified column according to the specified filter.


Visual Basic (Declaration) 
Public Sub AutoFilterColumn( _
   ByVal column As Integer, _
   ByVal filterString As String, _
   ByVal filterItemIndex As Integer _
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim column As Integer
Dim filterString As String
Dim filterItemIndex As Integer
instance.AutoFilterColumn(column, filterString, filterItemIndex)
public void AutoFilterColumn( 
   int column,
   string filterString,
   int filterItemIndex


Column index
Filter string
Filter item index


The third parameter, filterItemIndex, checks whether the index is 0 or not; it checks whether the "All" item is selected (which is always the first item in the list and so always has index of 0) or not. This uses an index (integer) as opposed to a boolean because it is exposed as a public method and the column may or may not be selected. If the filter is a single item (or none), then the string in the second parameter, filterString, is enough information. The filterString parameter should be an exact match for one of the strings returned by the GetDropDownFilterItems method for the column.


This example filters the second column.
C#Copy Code
fpSpread1.ActiveSheet.Columns[2].AllowAutoFilter = true;
fpSpread1.ActiveSheet.AutoFilterColumn(2, "London", 1); 

Visual BasicCopy Code
FpSpread1.ActiveSheet.Columns(2).AllowAutoFilter = True
FpSpread1.ActiveSheet.AutoFilterColumn(2, "London", 1) 


Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.