Print Page | Close Window

how to set auto sort in a reportctrl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=24100
Printed Date: 29 March 2024 at 11:00am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to set auto sort in a reportctrl
Posted By: yangyanhui
Subject: how to set auto sort in a reportctrl
Date 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



Replies:
Posted By: cpede
Date 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 (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net