Maintaining sort selection

Pringle

New member
Joined
Mar 12, 2007
Messages
2
Programming Experience
1-3
Hi all,
Im new to windows forms programming so forgive the ignorance.
I posted this over in the windows forms area but didnt get any bites so I was hoping maybe someone here could help me.
I have a datagridview and it columns are sortable. I cant seem to figure out how to programmatically determine what sort column was selected by the user, if any, so that when the timed refresh occurs I can resort based off of the last column sort selected.
Any ideas?
TIA,
Stue
 
In case someone else runs into the same issue:

VB.NET:
Private Sub dgResults_ColumnHeaderMouseClick(ByVal sender As Object, ByVal e As DataGridViewCellMouseEventArgs) Handles dgResults.ColumnHeaderMouseClick
        strSortColumn = e.ColumnIndex
        If Me.dgResults.SortOrder = SortOrder.Ascending Then
            dirSort = ListSortDirection.Ascending
        Else
            dirSort = ListSortDirection.Descending
        End If
    End Sub
 
Back
Top