Spread for ASP.NET 7.0 Product Documentation
SortInfo Constructor(Int32,Boolean,IComparer)
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SortInfo Class > SortInfo Constructor : SortInfo Constructor(Int32,Boolean,IComparer)


index
Index of the column or row on which to sort
ascending
Whether the sort order is ascending
comparer
IComparer object for method of comparison

Glossary Item Box

Creates a SortInfo object with the order specified and the comparison done according to the specified comparer.

Syntax

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

Parameters

index
Index of the column or row on which to sort
ascending
Whether the sort order is ascending
comparer
IComparer object for method of comparison

Example

This example sorts the columns using the sort array.
C#Copy Code
FarPoint.Web.Spread.SortInfo si0 = new FarPoint.Web.Spread.SortInfo(0, true, System.Collections.Comparer.Default);
FarPoint.Web.Spread.SortInfo si1 = new FarPoint.Web.Spread.SortInfo(1, true); FarPoint.Web.Spread.SortInfo si2 = new FarPoint.Web.Spread.SortInfo(2,
true);

FpSpread1.ActiveSheetView.SetValue(0, 0, "D"); FpSpread1.ActiveSheetView.SetValue(1, 0, "F"); FpSpread1.ActiveSheetView.SetValue(2,
0, "E");

FpSpread1.ActiveSheetView.SetValue(0, 1, "A"); FpSpread1.ActiveSheetView.SetValue(1, 1, "C"); FpSpread1.ActiveSheetView.SetValue(2,
1, "B");

FpSpread1.ActiveSheetView.SetValue(0, 2, "G"); FpSpread1.ActiveSheetView.SetValue(1, 2, "I"); FpSpread1.ActiveSheetView.SetValue(2,
2, "H");

FarPoint.Web.Spread.SortInfo[] si = new FarPoint.Web.Spread.SortInfo[] {si0, si1, si2}; FpSpread1.ActiveSheetView.SortColumns(0,
3, si);  

Visual BasicCopy Code
Dim si0 As New FarPoint.Web.Spread.SortInfo(0, True,
System.Collections.Comparer.Default)
Dim si1 As New FarPoint.Web.Spread.SortInfo(1, True)
Dim si2 As New FarPoint.Web.Spread.SortInfo(2, True)

FpSpread1.ActiveSheetView.SetValue(0, 0, "D") FpSpread1.ActiveSheetView.SetValue(1, 0, "F") FpSpread1.ActiveSheetView.SetValue(2,
0, "E")

FpSpread1.ActiveSheetView.SetValue(0, 1, "A") FpSpread1.ActiveSheetView.SetValue(1, 1, "C") FpSpread1.ActiveSheetView.SetValue(2,
1, "B")

FpSpread1.ActiveSheetView.SetValue(0, 2, "G") FpSpread1.ActiveSheetView.SetValue(1, 2, "I") FpSpread1.ActiveSheetView.SetValue(2,
2, "H")

Dim si() As FarPoint.Web.Spread.SortInfo = New
FarPoint.Web.Spread.SortInfo() {si0, si1, si2} FpSpread1.ActiveSheetView.SortColumns(0, 3, si) 

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.