Spread Windows Forms 12.0 Product Documentation
ColumnHeaderAutoFilterIndex Property
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : ColumnHeaderAutoFilterIndex Property
Gets or sets which column header row in the sheet displays the filter indicator when there are multiple column header rows.
Syntax
'Declaration
 
Public Property ColumnHeaderAutoFilterIndex As Integer
'Usage
 
Dim instance As SheetView
Dim value As Integer
 
instance.ColumnHeaderAutoFilterIndex = value
 
value = instance.ColumnHeaderAutoFilterIndex
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.
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;
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
See Also

Reference

SheetView Class
SheetView Members

User-Task Documentation

Managing Filtering of Rows