Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - how to set auto sort in a reportctrl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to set auto sort in a reportctrl

 Post Reply Post Reply
Author
Message
yangyanhui View Drop Down
Groupie
Groupie


Joined: 20 August 2020
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangyanhui Quote  Post ReplyReply Direct Link To This Post Topic: how to set auto sort in a reportctrl
    Posted: 23 November 2020 at 9:11pm
HI, I need to sort the records in a reportctrl automatically. records should be sorted by time desc. In other words, the new reached record should be insert into the first position. How can I realize it? thanks
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Status: Offline
Points: 598
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 24 November 2020 at 2:54am
My suggestion is that you add a hidden column with the absolute time when you add the record, and then sort on that column.
You can probably use the build in sorting algorithm if you use the CXTPReportRecordItemDateTime class for the items. Alternatively you can add your own Compare method.
Product: Xtreme ToolkitPro (19.1.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.078 seconds.