Spread Windows Forms 11.0 Product Documentation
ColumnHeaderAutoSortIndex Property
Example 


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

Reference

SheetView Class
SheetView Members

User-Task Documentation

Allowing the User to Perform Automatic Sorting