Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sort QM Grid by Date
#2
This is a pretty ugly solution, but it works for now. It does not allow you to toggle the sort order.

Code:
Copy      Help
,,case LVN_COLUMNCLICK ;;click header
,,sel nlv.iSubItem
,,,case 0
,,,ICsv v=CreateCsv()
,,,v.Separator="[9]"
,,,g.ToICsv(v)
,,,for r 0 v.RowCount
,,,,dPUB=v.Cell(r 0)
,,,,str Date8.timeformat("{yyyy}{MM}{dd}" dPUB)
,,,,v.Cell(r 0)=Date8
,,,v.Sort(4)
,,,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}"
,,,g.FromICsv(v)
,,,case else
,,,g.Sort(4|0x10000 nlv.iSubItem)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)