How to sort Item in CListCtrl in MFC?

2019-03-06 08:29发布

问题:

I made a Dialog based application in MFC. I put CListCtrl control on my Dialog and set its view style to report type. I have five columns in this list view. All columns are of String type. I want to implement the sorting in this list, That is when I click on a column it should sort item in the list. I saw many examples related to this. but none is working for me. Can some one guide me how to do that???

Thanks

回答1:

Since it is MFC, this sample and this sample should work.



回答2:

List Sorting

This works perfectly. Thanks for your cooperation.