Print Page | Close Window

CXTListCtrl custom sorting

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2732
Printed Date: 08 November 2025 at 7:15pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTListCtrl custom sorting
Posted By: jlee
Subject: CXTListCtrl custom sorting
Date Posted: 16 August 2005 at 3:24pm

Hi,

I'm having a problem of implementing a custom sorting (by date) for CXTListCtrl. I overrided the 'SortList' function in my derived class. But somehow this function is not called when the list header column is clicked (it still conducts the default text sorting). Could you show me an example how I can do this? I'm using Toolkit Pro 9.51.

Thanks in advance,

Best regards,

JLee 




Replies:
Posted By: Oleg
Date Posted: 17 August 2005 at 7:39am

Hello,

Show your code. Did you try to trace?



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jlee
Date Posted: 17 August 2005 at 11:33am

Hi oleg,

Thanks for your response. I did trace into the part of my code.

The attached is a project I modified directly from the original ListCtrl sample code of Toolkit Pro 9.51. I added a derived class 'CMySortListCtrl', in which I overrided the virtual function 'SortList' (its code I directly copy and pasted from CXTShellListBase::SortList). Then I changed the declaration of the member variable 'm_listCtrl' in 'CListCtrlDlg' to 'CMySortListCtrl'. The project was compiled in VS7.0.

(I think I may find the problem now. It tends out that the 'SortColumn' gets notified for sorting when the list header is clicked in the sample. The overrided 'SortList' function is not called. Is this the way it is supposed to work?)

Thanks again,

JLee

http://forum.codejock.com/uploads/jlee/2005-08-17_112433_ListCtrl.zip - 2005-08-17_112433_ListCtrl.zip  

 

 



Posted By: Oleg
Date Posted: 17 August 2005 at 2:04pm

in ListCtrlDlg.h replace

CXTtHeaderCtrl m_header;

to

CXTFlatHeaderCtrl m_header;



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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