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

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 ;-)

-Jim
#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)
#3
In next QM, DlgGrid.Sort and ICsv.Sort will have flag 128 - sort as date.
This week.
#4
That's great to hear!
Thank you so much Gintaras.

-jim


Forum Jump:


Users browsing this thread: 1 Guest(s)