Spread Windows Forms 6.0 Product Documentation
AutoFilterIndex Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > ColumnHeader Class : AutoFilterIndex Property


Glossary Item Box

Gets or sets which column header row displays the row filter indicator when there are multiple column header rows.

Syntax

Visual Basic (Declaration) 
Public Property AutoFilterIndex As Integer
Visual Basic (Usage)Copy Code
Dim instance As ColumnHeader
Dim value As Integer
 
instance.AutoFilterIndex = value
 
value = instance.AutoFilterIndex
C# 
public int AutoFilterIndex {get; set;}

Property Value

Integer index of the row

Remarks

If your header has multiple column header rows, you can specify which row displays the filtering indicator by setting this property. To specify the index, set the property to a value between 0 and n-1, where 0 is the top row and n is the number of header rows. Any value above n-1 simply puts the filtering indicator in the bottom row.

If you set this property to specify a row to display the filtering indicator, for example, header row 3, and then later change the number of column header rows to be less than 3, the filtering indicator is displayed in the bottom row, as if the RowCount property is set to -1. However, if you then change the number of header rows to 3 or greater, the filtering indicator is again displayed in header row 3. Use the RowCount property to specify how many column header rows the component displays.

This property does not have an effect unless the Visible property (or the SheetView.ColumnHeaderVisible property) is set to true and the column header rows are not hidden.

Example

This example designates the row in the column headers in which to display the filter icon.
C#Copy Code
fpSpread1.ActiveSheet.ColumnHeaderRowCount = 3;
fpSpread1.ActiveSheet.ColumnHeader.AutoFilterIndex = 1;

FarPoint.Win.Spread.DefaultFilter df = new FarPoint.Win.Spread.DefaultFilter(fpSpread1.ActiveSheet);
df.ShowFilterInDropDown(1, new int[] {1, 2, 3, 4, 5, 6, 7, 8});

FarPoint.Win.Spread.NamedStyle instyle = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle outstyle = new FarPoint.Win.Spread.NamedStyle();
instyle.BackColor = Color.Yellow;
outstyle.BackColor = Color.Aquamarine;

FarPoint.Win.Spread.FilterColumnDefinition fcd = new FarPoint.Win.Spread.FilterColumnDefinition(1);
FarPoint.Win.Spread.FilterColumnDefinition fcd1 = new FarPoint.Win.Spread.FilterColumnDefinition(2);
FarPoint.Win.Spread.FilterColumnDefinition fcd2 = new FarPoint.Win.Spread.FilterColumnDefinition(3);

FarPoint.Win.Spread.CustomFilterItem cfi = new FarPoint.Win.Spread.CustomFilterItem("Contains an 'A'", df);
fcd.CustomFilters.Add(cfi);

FarPoint.Win.Spread.StyleRowFilter srf = new FarPoint.Win.Spread.StyleRowFilter(fpSpread1.ActiveSheet, instyle, outstyle);
srf.AddColumn(fcd);
srf.AddColumn(fcd1);
srf.AddColumn(fcd2);

fpSpread1.ActiveSheet.RowFilter = srf;
Visual BasicCopy Code
FpSpread1.ActiveSheet.ColumnHeaderRowCount = 3
FpSpread1.ActiveSheet.ColumnHeader.AutoFilterIndex = 1

Dim df As New FarPoint.Win.Spread.DefaultFilter(FpSpread1.ActiveSheet)
df.ShowFilterInDropDown(1, New Integer() {1, 2, 3, 4, 5, 6, 7, 8})

Dim instyle As New FarPoint.Win.Spread.NamedStyle
Dim outstyle As New FarPoint.Win.Spread.NamedStyle
instyle.BackColor = Color.Yellow
outstyle.BackColor = Color.Aquamarine

Dim fcd As New FarPoint.Win.Spread.FilterColumnDefinition(1)
Dim fcd1 As New FarPoint.Win.Spread.FilterColumnDefinition(2)
Dim fcd2 As New FarPoint.Win.Spread.FilterColumnDefinition(3)

Dim cfi As New FarPoint.Win.Spread.CustomFilterItem("Contains an 'A'", df)
fcd.CustomFilters.Add(cfi)

Dim srf As New FarPoint.Win.Spread.StyleRowFilter(FpSpread1.ActiveSheet, instyle, outstyle)
srf.AddColumn(fcd)
srf.AddColumn(fcd1)
srf.AddColumn(fcd2)

FpSpread1.ActiveSheet.RowFilter = srf

Requirements

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.