Spread for ASP.NET 11 Product Documentation
SortColumns(Int32,Boolean,IComparer) Method
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class > SortColumns Method : SortColumns(Int32,Boolean,IComparer) Method
Row whose values are compared during sorting
Whether the sort is ascending
IComparer object used to compare the values
Sorts all the columns in the sheet according to the specified parameters.
Syntax
'Declaration
 
Public Overloads Function SortColumns( _
   ByVal keyRow As Integer, _
   ByVal ascending As Boolean, _
   ByVal comparer As IComparer _
) As Boolean
'Usage
 
Dim instance As SheetView
Dim keyRow As Integer
Dim ascending As Boolean
Dim comparer As IComparer
Dim value As Boolean
 
value = instance.SortColumns(keyRow, ascending, comparer)
public bool SortColumns( 
   int keyRow,
   bool ascending,
   IComparer comparer
)

Parameters

keyRow
Row whose values are compared during sorting
ascending
Whether the sort is ascending
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 columns in the sheet. It is similar to the simple method,SortColumns(Int32,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 columns 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.SortColumns(0, false, 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.SortColumns(0, False, System.Collections.Comparer.Default)
See Also

Reference

SheetView Class
SheetView Members
Overload List