Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTListCtrl custom sorting
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTListCtrl custom sorting

 Post Reply Post Reply
Author
Message
jlee View Drop Down
Newbie
Newbie


Joined: 06 December 2004
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote jlee Quote  Post ReplyReply Direct Link To This Post Topic: CXTListCtrl custom sorting
    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 

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2005 at 7:39am

Hello,

Show your code. Did you try to trace?

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jlee View Drop Down
Newbie
Newbie


Joined: 06 December 2004
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote jlee Quote  Post ReplyReply Direct Link To This Post 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

2005-08-17_112433_ListCtrl.zip 

 

 

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2005 at 2:04pm

in ListCtrlDlg.h replace

CXTtHeaderCtrl m_header;

to

CXTFlatHeaderCtrl m_header;

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.051 seconds.