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.