Unicode Controls & Classes for VB6 - Version 4

ctlUniGrid.SortCompareRows Event

Raised if you chose to sort a column using a custom event

Syntax
Public Event SortCompareRows (ByRef vColKey As Variant,
ByVal iRow1 As Long,
ByVal iRow2 As Long,
ByVal bSortAscending As Boolean,
ByRef bRetFirstIsGreater As Boolean)
Parameters
Parameter Description
ByRef vColKey As Variant The column key
ByVal iRow1 As Long The first row to check
ByVal iRow2 As Long The second row to check
ByVal bSortAscending As Boolean True if you requested to sort ascending, False otherwise
ByRef bRetFirstIsGreater As Boolean Return True if the element in iRow1 is greater, False otherwise
Remarks
Private Sub fxGrid_SortCompareRows( _
vColKey As Variant, ByVal iRow1 As Long, ByVal iRow2 As Long, _
ByVal bSortAscending As Boolean, bRetFirstIsMajor As Boolean)

Dim sData1 As String
Dim sData2 As String
sData1 = fxGrid.CellValue(iRow1, vColKey)
sData2 = fxGrid.CellValue(iRow2, vColKey)

If bSortAscending Then
bRetFirstIsMajor = (StrComp(sData1, sData2, vbTextCompare) = 1)
Else
bRetFirstIsMajor = (StrComp(sData1, sData2, vbTextCompare) = -1)
End If
End Sub