Spread Windows Forms 11.0 Product Documentation
GetColumnAutoFilterIndex Method
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : GetColumnAutoFilterIndex Method
Column index
Gets the automatic filter index for the specified column.
Syntax
'Declaration
 
Public Function GetColumnAutoFilterIndex( _
   ByVal column As Integer _
) As Integer
'Usage
 
Dim instance As SheetView
Dim column As Integer
Dim value As Integer
 
value = instance.GetColumnAutoFilterIndex(column)
public int GetColumnAutoFilterIndex( 
   int column
)

Parameters

column
Column index

Return Value

Automatic filter index
Remarks
The automatic filter index is the row index in the column header where the auto filter indicator is drawn.
Example
This example gets the index for the column filter.
private void Form1_Load(object sender, EventArgs e)
        {
            fpSpread1.Sheets[0].ColumnHeader.RowCount = 3;
            fpSpread1.Sheets[0].ColumnHeaderAutoTextIndex = 1;
            fpSpread1.Sheets[0].Cells[0, 0].Text = "Testing";
            fpSpread1.Sheets[0].Columns[0, 2].AllowAutoSort = true;
            fpSpread1.Sheets[0].Columns[3].AllowAutoFilter = true;
            fpSpread1.Sheets[0].SetColumnAutoSortIndex(0, 0);
            fpSpread1.Sheets[0].SetColumnAutoFilterIndex(3, 1);          
        }

private void button1_Click(object sender, EventArgs e)
        {
            listBox1.Items.Add(fpSpread1.Sheets[0].GetColumnAutoSortIndex(0).ToString());
            listBox1.Items.Add(fpSpread1.Sheets[0].GetColumnAutoFilterIndex(3).ToString());         
        }
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        FpSpread1.Sheets(0).ColumnHeader.RowCount = 3
        FpSpread1.Sheets(0).ColumnHeaderAutoTextIndex = 1
        FpSpread1.Sheets(0).Cells(0, 0).Text = "Testing"
        FpSpread1.Sheets(0).Columns(0, 2).AllowAutoSort = True
        FpSpread1.Sheets(0).Columns(3).AllowAutoFilter = True
        FpSpread1.Sheets(0).SetColumnAutoSortIndex(0, 0)
        FpSpread1.Sheets(0).SetColumnAutoFilterIndex(3, 1)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ListBox1.Items.Add(FpSpread1.Sheets(0).GetColumnAutoSortIndex(0).ToString())
        ListBox1.Items.Add(FpSpread1.Sheets(0).GetColumnAutoFilterIndex(3).ToString())
End Sub
See Also

Reference

SheetView Class
SheetView Members