I was trying to toggle the sort order of the columns, but it complains about the sortorder if-then portion.
How do I get it to toggle ascending/descending?
I trying using the
Dim ord statement to return the ascending/descending values but it keeps complaining, so I then just used the 1 & 2 integers for sort order but it didn't like that either.

    Private Sub IGrid1_ColHdrClick(sender As Object, e As iGColHdrClickEventArgs) Handles IGrid1.ColHdrClick

        With IGrid1
            Dim idx As Integer = .CurColHdr.ColIndex
            If idx < 3 Then
                Dim ord As iGSortOrder
                'If .SortObject(idx).SortOrder = 1 Then
                '    .SortObject(idx).SortOrder = 2
                '    .SortObject(idx).SortOrder = 1
                'End If
            End If

        End With
    End Sub
The type of the SortOrder property you try to change is iGSortOder, so you need to assign iGSortOrder.Ascending and iGSortOrder.Descending instead of the values 1 and 2. If this does work, can you send us a project that demonstrates this problem?

And why do you need to switch sort order this way by writing your code? It seems, iGrid does what you need by default without additional coding.

Note also that you need to prevent iGrid from doing this default action too if you go this way.
I couldn't seem to get it to sort without going this way.
What properties do I need to set to get it to work?
You do not need to set any properties to allow sorting by column header clicks. This should work "out-of-the-box", i.e. when you drop the control from the VS Toolbox on the form.

Send us, please, a sample that demonstrates your issue.
  Sorting (431kb) downloaded 80 time(s).

Here you go.
Thank you - the project helped to understand why your columns are not sorted by column header clicks. The reason is that you set the SortOrder property for your columns to 'None'. The help topic dedicated to the iGCol.SortOrder property contains the following sentences:


Note that this property does not reflect the current sort order, it indicates the order of the sort which will be performed when the column's header is clicked if the column was not sorted before.



If None is specified, the column cannot be sorted and grouped through visual interface.

To solve your problem, reset the SortOrder property to its default value 'Ascending' for the required columns.