Re: CListCtrl sort not working
- From: "Tom Serface" <tom.nospam@xxxxxxxxxxxxx>
- Date: Sat, 19 Apr 2008 08:38:49 -0700
This article should help you:
http://support.microsoft.com/kb/250614
Tom
"Bill Brehm >" <<don't want spam> wrote in message news:eProxrioIHA.548@xxxxxxxxxxxxxxxxxxxxxxx
I have a CListCtrl. In response to pressing one of the columns, I process the LVN_COLUMNCLICK notification by calling SortItems() and providing a callback. The two parameters coming to my callback function are always zero. The documentation implies that the two parameters are indexes of two rows to be compared. I did a search and found this FAQ http://www.celticwolf.com/FAQs/CListCtrl_FAQ.html#Q14 that says those parameters are really the 32 bit data item stored in the row item. I confirmed this. Unfortunately the FAQ doesn't suggest how this should be used. I did try to set the data item equal to the index of the row item and the first sort works. Problem is, a subsequent sort doesn't work because now the data item no longer matches the actual index of the row item. I suppose I could change the data items depending on whether I pass back a positive, zero or negative value, but it seems to me I shouldn't have to do that and also, it seems to me that the data item loses it's usefulness if I just have to store an index in it.
So how is a sort meant to work?
Thanks...
.
- Follow-Ups:
- Re: CListCtrl sort not working
- From: Bill Brehm
- Re: CListCtrl sort not working
- From: Giovanni Dicanio
- Re: CListCtrl sort not working
- References:
- CListCtrl sort not working
- From: Bill Brehm
- CListCtrl sort not working
- Prev by Date: CListCtrl sort not working
- Next by Date: Re: return string
- Previous by thread: CListCtrl sort not working
- Next by thread: Re: CListCtrl sort not working
- Index(es):
Relevant Pages
|