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


Glossary Item Box

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

Syntax

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

Property Value

Integer index of the row in the column header

Remarks

This property is available at run time only.

This property is equivalent to the ColumnHeader.AutoSortIndex property.

Example

This example sets the row index in the column headers in which sort indicators are displayed.
C#Copy Code
Random r = new Random();
int i, j;
for (i = 0; i<=50; i++)
{
    for (j = 0; j<=3; j++)
        fpSpread1.ActiveSheet.SetValue(i, j, r.Next(1, 200).ToString());
}
fpSpread1.ActiveSheet.Columns[0].SortIndicator = FarPoint.Win.Spread.Model.SortIndicator.Ascending;
fpSpread1.ActiveSheet.Columns[0].AllowAutoSort = true;
fpSpread1.ActiveSheet.Columns[1].SortIndicator = FarPoint.Win.Spread.Model.SortIndicator.Ascending;
fpSpread1.ActiveSheet.Columns[1].AllowAutoSort = true;
fpSpread1.ActiveSheet.Columns[2].SortIndicator = FarPoint.Win.Spread.Model.SortIndicator.Ascending;
fpSpread1.ActiveSheet.Columns[2].AllowAutoSort = true;
fpSpread1.ActiveSheet.ColumnHeaderRowCount = 3;
fpSpread1.ActiveSheet.ColumnHeaderAutoSortIndex = 1;
Visual BasicCopy Code
Dim r As New Random()
Dim i, j, x As Integer
For i = 0 To 50
    For j = 0 To 3
        FpSpread1.ActiveSheet.SetValue(i, j, r.Next(1, 200).ToString())
        FpSpread1.ActiveSheet.Columns(j).SortIndicator = FarPoint.Win.Spread.Model.SortIndicator.Ascending
        FpSpread1.ActiveSheet.Columns(j).AllowAutoSort = True
    Next j
Next i
FpSpread1.ActiveSheet.ColumnHeaderRowCount = 3
FpSpread1.ActiveSheet.ColumnHeaderAutoSortIndex = 1

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.