Spread for ASP.NET 8.0 Product Documentation
SortRows(Int32,Boolean,Boolean,IComparer) Method
Example 


Column whose values are compared during sorting
Whether the sort is ascending
Whether to display the sort indicator
IComparer object used to compare the values
Sorts all the rows in the sheet according to the specified parameters.
Syntax
'Declaration
 
Public Overloads Function SortRows( _
   ByVal keyColumn As Integer, _
   ByVal ascending As Boolean, _
   ByVal showIndicator As Boolean, _
   ByVal comparer As IComparer _
) As Boolean
'Usage
 
Dim instance As SheetView
Dim keyColumn As Integer
Dim ascending As Boolean
Dim showIndicator As Boolean
Dim comparer As IComparer
Dim value As Boolean
 
value = instance.SortRows(keyColumn, ascending, showIndicator, comparer)
public bool SortRows( 
   int keyColumn,
   bool ascending,
   bool showIndicator,
   IComparer comparer
)

Parameters

keyColumn
Column whose values are compared during sorting
ascending
Whether the sort is ascending
showIndicator
Whether to display the sort indicator
comparer
IComparer object used to compare the values

Return Value

true if successful; otherwise false
Remarks
This method can be used to sort all the rows in the sheet. It is similar to the simple method,SortRows(Int32,Boolean,Boolean), but adds an option for specifying the way of comparing that is used. Use this method to do a sort beyond the comparison technique provided by the comparer in the .NET framework.
Example
This example illustrates the use of this member by sorting the rows with the specified parameters.
FarPoint.Web.Spread.SheetView sv;
FarPoint.Web.Spread.SortInfo[] s = new FarPoint.Web.Spread.SortInfo[1];
s[0] = new FarPoint.Web.Spread.SortInfo(0, false);
sv = FpSpread1.ActiveSheetView;
sv.SortRows(0, false, true, System.Collections.Comparer.Default);
Dim sv As FarPoint.Web.Spread.SheetView
Dim s(1) As FarPoint.Web.Spread.SortInfo
s(0) = New FarPoint.Web.Spread.SortInfo(0, False)
sv = FpSpread1.ActiveSheetView
sv.SortRows(0, False, True, System.Collections.Comparer.Default)
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

Reference

SheetView Class
SheetView Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.