SORT msflexgrid with decimal and negative and positive number

User avatar
sal21
PlatinumLounger
Posts: 4440
Joined: 26 Apr 2010, 17:36

SORT msflexgrid with decimal and negative and positive number

Post by sal21 »

i just have in ciolumn 1 this:

0,45
0,7
-0,47
-11,80
0,5
ecc...

how to sort the value?
Tks

User avatar
HansV
Administrator
Posts: 78991
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SORT msflexgrid with decimal and negative and positive number

Post by HansV »

I assume that you populate the flexgrid from a recordset. Can't you sort the recordset?
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4440
Joined: 26 Apr 2010, 17:36

Re: SORT msflexgrid with decimal and negative and positive number

Post by sal21 »

HansV wrote:
29 May 2024, 20:01
I assume that you populate the flexgrid from a recordset. Can't you sort the recordset?
Sorry...

I need to sort the
msflexgrid by click column header

User avatar
HansV
Administrator
Posts: 78991
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SORT msflexgrid with decimal and negative and positive number

Post by HansV »

I'm sorry, I cannot help you with that.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4440
Joined: 26 Apr 2010, 17:36

Re: SORT msflexgrid with decimal and negative and positive number

Post by sal21 »

HansV wrote:
29 May 2024, 21:25
I'm sorry, I cannot help you with that.
No Pro.
If i resolve post the solution here.
As usuale.

User avatar
SpeakEasy
5StarLounger
Posts: 600
Joined: 27 Jun 2021, 10:46

Re: SORT msflexgrid with decimal and negative and positive number

Post by SpeakEasy »

Code: Select all

Private Sub MSFlexGrid1_Click()
    If MSFlexGrid1.Row = 1 Then MSFlexGrid1.Sort = flexSortGenericAscending
End Sub

User avatar
sal21
PlatinumLounger
Posts: 4440
Joined: 26 Apr 2010, 17:36

Re: SORT msflexgrid with decimal and negative and positive number

Post by sal21 »

SpeakEasy wrote:
30 May 2024, 11:08

Code: Select all

Private Sub MSFlexGrid1_Click()
    If MSFlexGrid1.Row = 1 Then MSFlexGrid1.Sort = flexSortGenericAscending
End Sub
I Test, now and work!
tks bro