Dim newColumn As DataGridViewColumn = DataGridView1.Columns(e.ColumnIndex) Dim direction As System.ComponentModel.ListSortDirection If DataGridView1.SortOrder = SortOrder.Ascending Then direction = System.ComponentModel.ListSortDirection.Descending Else direction = System.ComponentModel.ListSortDirection.Ascending End If If newColumn IsNot Nothing Then DataGridView1.Sort(newColumn, direction) End If
原文:https://www.cnblogs.com/rf8862/p/12274851.html