Spread for ASP.NET 7.0 Product Documentation
Sort Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class : Sort Method


row
Starting sheet row index
column
Starting sheet column index
rowCount
Number of rows in the sheet to sort
columnCount
Number of columns in the sheet to sort
byRows
Whether the sort should move rows in the range (true) or columns in the range (false)
sortInfo
Array of SortInfo objects containing the column indexes (if byRows is true) or row indexes (if byRows is false) and the order of sorting

Glossary Item Box

Sorts a range of cells in the data model.

Syntax

Visual Basic (Declaration) 
Public Function Sort( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer, _
   ByVal byRows As Boolean, _
   ByVal sortInfo() As SortInfo _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim row As Integer
Dim column As Integer
Dim rowCount As Integer
Dim columnCount As Integer
Dim byRows As Boolean
Dim sortInfo() As SortInfo
Dim value As Boolean
 
value = instance.Sort(row, column, rowCount, columnCount, byRows, sortInfo)
C# 
public bool Sort( 
   int row,
   int column,
   int rowCount,
   int columnCount,
   bool byRows,
   SortInfo[] sortInfo
)

Parameters

row
Starting sheet row index
column
Starting sheet column index
rowCount
Number of rows in the sheet to sort
columnCount
Number of columns in the sheet to sort
byRows
Whether the sort should move rows in the range (true) or columns in the range (false)
sortInfo
Array of SortInfo objects containing the column indexes (if byRows is true) or row indexes (if byRows is false) and the order of sorting

Return Value

true if successful; otherwise false

Example

This example illustrates the use of this member by setting the range of cells for the sort.
C#Copy Code
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.Sort(0, 0, 3, 1, true, s);
Visual BasicCopy Code
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.Sort(0, 0, 3, 1, True, s)

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.