whenever a user click on the header of the flexgrid then which function can show its list ascending / desending.
any sugestion.
whenever a user click on the header of the flexgrid then which function can show its list ascending / desending.
any sugestion.
If you're using VB6 then see if this sample works for you:
Also, original idea was posted here. Read all the comments.Code:Option Explicit Private Sub Form_Load() Dim i As Integer Dim j As Integer With MSFlexGrid1 .Rows = 10 .Cols = 5 For j = 0 To .Rows - 1 For i = 0 To .Cols - 1 .TextMatrix(j, i) = j + 1 * (i + 1) Next i Next j End With MSFlexGrid1_Click 'force sort asc End Sub Private Sub MSFlexGrid1_Click() Static sortA As Boolean With MSFlexGrid1 .RowSel = .Row .Col = .Col .ColSel = .Col If Not sortA Then .Sort = flexSortGenericAscending sortA = True Else .Sort = flexSortGenericDescending sortA = False End If End With End Sub
Microsoft MVP - Visual Basic 2006-2013
Why VB clears the clipboard on startup and how to avoid it? . Filtering Arrays . Save File To Database . Extract File From Database .
Extract picture from database without using hard drive . Change Menu BackColor . How to use MS Flexgrid . Make Frame Transparent .
The Easiest Way to Create an NT Service With VB6 . How to comment blocks of code in VB5 and VB6 . How to find and replace missing members of control array
Visual Basic 6.0 On-Line Documentation . Connection Strings