Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting a flexgrid control from the column header 2

Status
Not open for further replies.

dlambert

Programmer
Apr 4, 2001
6
US
I have several datagrid controls that sort based on a column header click event, but the Flexgrid does not have a headerclick event. Any ideas how I can accomplish the same thing as my datagrid control so that me users don't have to think about right clicking on a selected column?
 
Try this:

Private Sub FG1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If FG1.MouseRow = 0 Then
If Button = 1 Then 'left mouse button
FG1.col = FG1.MouseCol
FG1.ColSel = FG1.MouseCol
FG1.Sort = 1
End If
End If
End Sub

Herman :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top