比如我单击一下DataGrid标头栏,里面内容会从小到大排序,再单击标头栏第二次,里面内容会从大到小排序。
请问如何实现?(答的好加分)!!
以下是我在DataGrid1_HeadClick事件写的。但还是不对。
Private Sub Form_Load()
lastCol = -1
End Sub
Private Sub DataGrid1_HeadClick(ByVal ColIndex As Integer)
Select Case ColIndex
Case 0
If DataGrid1.Col <> lastCol Then
rs.Sort = "Price ASC"
lastCol = 1
Else
rs.Sort = "Price DESC"
End If
End Select
End Sub
谁能回答,我不须其他的控件请直接回答DataGrid1的问题!