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


column
Column index
value
Auto sort index

Glossary Item Box

Sets the automatic sort index for the specified column.

Syntax

Visual Basic (Declaration) 
Public Sub SetColumnAutoSortIndex( _
   ByVal column As Integer, _
   ByVal value As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim column As Integer
Dim value As Integer
 
instance.SetColumnAutoSortIndex(column, value)
C# 
public void SetColumnAutoSortIndex( 
   int column,
   int value
)

Parameters

column
Column index
value
Auto sort index

Remarks

The value -1 indicates that the column should inherit the setting from the default column, and the default value is -1 which indicates that the indicator should be painted in the last column header row.

Example

This example specifies the column header row location of the sort index.
C#Copy Code
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());         
        }
Visual BasicCopy Code
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

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.