• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 340
  • Last Modified:

FlexGrid Sorting Question....

If my column is text and represents time-of-day:
ie:     7:00am    11:30am    4:50pm    etc.
This sort command:
MSFlex2.Sort = flexSortStringAscending
puts 4:50pm in front of 7:00am because of the numerics.
What command will sort my grid according to time-of-day?
0
rbend
Asked:
rbend
1 Solution
 
PePiCommented:
create another column with 0 width (.ColWidth(c) = 0; where c is the column); then based on your column with the time, copy the value to the 0 width column and format with FORMAT(CDate(.textmatrix(.row, 1)), "HH:mm:ss"). therefore, assuming that the time column is 1 and your 0 width column (or your sort column) is 2 then:

MSFlex2.textmatrix(.row, 2) = Format(MSFlex2.textmatrix(.row,1),"HH:mm:ss")
MSFlex2.colsel = 2      'this will set the column with the military time format as your sorting column
MSFlex2.Sort = flexSortStringAscending


HTH!



0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now