Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sort QM Grid by Date

I don't know if this is already possible or if it needs to be added to the QM wish list.

User a QM grid in a dialog, is there any way to click on the the header of a column using a date picker to sort all of the data by the date?

I think I may have a couple ideas, but I just wanted to put this out there just in case someone else is wondering or even if other people have a quick solution they are already using ;-)

This is a pretty ugly solution, but it works for now. It does not allow you to toggle the sort order.

Copy      Help
,,case LVN_COLUMNCLICK ;;click header
,,sel nlv.iSubItem
,,,case 0
,,,ICsv v=CreateCsv()
,,,for r 0 v.RowCount
,,,,dPUB=v.Cell(r 0)
,,,,str Date8.timeformat("{yyyy}{MM}{dd}" dPUB)
,,,,v.Cell(r 0)=Date8
,,,for r 0 v.RowCount
,,,,Date8=v.Cell(r 0)
,,,,str YEAR.get(Date8 0 4)
,,,,str MONTH.get(Date8 4 2)
,,,,str DAY.get(Date8 6 2)
,,,,v.Cell(r 0)=F"{MONTH}/{DAY}/{YEAR}"
,,,case else
,,,g.Sort(4|0x10000 nlv.iSubItem)
In next QM, DlgGrid.Sort and ICsv.Sort will have flag 128 - sort as date.
This week.
That's great to hear!
Thank you so much Gintaras.


Forum Jump:

Users browsing this thread: 1 Guest(s)