FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > ColumnHeader Class : AutoSortIndex Property |
'Declaration Public Property AutoSortIndex As Integer
'Usage Dim instance As ColumnHeader Dim value As Integer instance.AutoSortIndex = value value = instance.AutoSortIndex
public int AutoSortIndex {get; set;}
If your header has multiple column header rows, you can specify which row displays the sort indicator by setting this property. To specify the index, set the property to a value between 0 and n-1, where 0 is the top row and n is the number of header rows. Any value above n-1 simply puts the sort indicator in the bottom row.
If you set this property to specify a row to display the sorting indicator, for example, header row 3, and then later change the number of column header rows to be less than 3, the sort indicator is displayed in the bottom row, as if the RowCount property is set to -1. However, if you then change the number of header rows to 3 or greater, the sort indicator is again displayed in header row 3. Use the RowCount property to specify how many column header rows the component displays.
You can allow users to sort data by clicking a column header using the Column.AllowAutoSort property (or SheetView.AutoSortColumn property) to specify the type of sorting and whether to display the sort indicator.
This property does not have an effect unless the Visible property (or the SheetView.ColumnHeaderVisible property) is set to true, the column header that displays the sort indicator is not hidden, and the Column.AllowAutoSort property (or SheetView.AutoSortColumn property) is set to true.
FarPoint.Win.Spread.ColumnHeader ch;
ch = fpSpread1.ActiveSheet.ColumnHeader;
ch.RowCount = 3;
ch.AutoSortIndex = 2;
fpSpread1.ActiveSheet.Columns[-1].AllowAutoSort = true;
Dim ch As FarPoint.Win.Spread.ColumnHeader ch = FpSpread1.ActiveSheet.ColumnHeader ch.RowCount = 3 ch.AutoSortIndex = 2 FpSpread1.ActiveSheet.Columns(-1).AllowAutoSort = True
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10