Spread Windows Forms 6.0 Product Documentation
SortInfo Constructor(Int32,Boolean)
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SortInfo Class > SortInfo Constructor : SortInfo Constructor(Int32,Boolean)


index
Index of the column or row on which to sort
ascending
Whether sort order is ascending

Glossary Item Box

Creates a SortInfo object with the order specified and the comparison done using the system default comparer.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal index As Integer, _
   ByVal ascending As Boolean _
)
Visual Basic (Usage)Copy Code
Dim index As Integer
Dim ascending As Boolean
 
Dim instance As New SortInfo(index, ascending)
C# 
public SortInfo( 
   int index,
   bool ascending
)

Parameters

index
Index of the column or row on which to sort
ascending
Whether sort order is ascending

Example

C#Copy Code
FarPoint.Win.Spread.SortInfo[] sort = new FarPoint.Win.Spread.SortInfo[1];
sort[0] = new FarPoint.Win.Spread.SortInfo(0, true);
fpSpread1.ActiveSheet.SetValue(0, 0, "S");
fpSpread1.ActiveSheet.SetValue(0, 1, "E");
fpSpread1.ActiveSheet.SetValue(0, 2, "A");
fpSpread1.ActiveSheet.SetValue(0, 3, "K");
fpSpread1.ActiveSheet.SetValue(1, 0, "W");
fpSpread1.ActiveSheet.SetValue(1, 1, "G");
fpSpread1.ActiveSheet.SetValue(1, 2, "P");
fpSpread1.ActiveSheet.SetValue(1, 3, "V");
fpSpread1.ActiveSheet.SetValue(2, 0, "O");
fpSpread1.ActiveSheet.SetValue(2, 1, "L");
fpSpread1.ActiveSheet.SetValue(2, 2, "Q");
fpSpread1.ActiveSheet.SetValue(2, 3, "H");
fpSpread1.ActiveSheet.SortColumns(0, 2, sort);
Visual BasicCopy Code
Dim sort(1) As FarPoint.Win.Spread.SortInfo
sort(0) = New FarPoint.Win.Spread.SortInfo(0, True)
FpSpread1.ActiveSheet.SetValue(0, 0, "S")
FpSpread1.ActiveSheet.SetValue(0, 1, "E")
FpSpread1.ActiveSheet.SetValue(0, 2, "A")
FpSpread1.ActiveSheet.SetValue(0, 3, "K")
FpSpread1.ActiveSheet.SetValue(1, 0, "W")
FpSpread1.ActiveSheet.SetValue(1, 1, "G")
FpSpread1.ActiveSheet.SetValue(1, 2, "P")
FpSpread1.ActiveSheet.SetValue(1, 3, "V")
FpSpread1.ActiveSheet.SetValue(2, 0, "O")
FpSpread1.ActiveSheet.SetValue(2, 1, "L")
FpSpread1.ActiveSheet.SetValue(2, 2, "Q")
FpSpread1.ActiveSheet.SetValue(2, 3, "H")
FpSpread1.ActiveSheet.SortColumns(0, 2, sort)

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.