Hi
I have a datagrid bound to a recordset. What I want to be able to do is sort the data when I click on any heading on any of the columns within datagird.
I've tried and tried but no luck
Any help would be great!
Thanks in advance
Manny
Printable View
Hi
I have a datagrid bound to a recordset. What I want to be able to do is sort the data when I click on any heading on any of the columns within datagird.
I've tried and tried but no luck
Any help would be great!
Thanks in advance
Manny
Try this code
Private Sub dgUserList_HeadClick(ByVal ColIndex As Integer)
adcUserList.RecordSource = "Select * From tlkpOlarisUsers order by " & _
dgUserList.Columns(ColIndex).DataField
End Sub
Try to use MSHFlexGrid. Code example:
Set Me.MSHFlexGrid1.DataSource = Me.adcReport
Me.MSHFlexGrid1.Sort = 7
Sort Property
-----------------
flexSortNone 0 None.
flexSortGenericAscending 1
flexSortGenericDescending 2
flexSortNumericAscending 3
flexSortNumericDescending 4 flexSortStringNoCaseAsending 5 flexSortNoCaseDescending 6
flexSortStringAscending 7
flexSortStringDescending 8