Spread Windows Forms 7.0 Product Documentation
ColumnHeaderAutoFilterIndex Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : ColumnHeaderAutoFilterIndex Property


Glossary Item Box

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

Syntax

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

Property Value

Integer index of the row in the column header

Remarks

This property is equivalent to the ColumnHeader.AutoFilterIndex property.

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.ColumnHeaderAutoFilterIndex = 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.ColumnHeaderAutoFilterIndex = 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 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

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