Turn off sorting in CListCtrl
Posted on 1998-06-24
I've got a CListCtrl in a dialog that has a list of files as it's items, and some other data (for each file) as subitems. I'd like to have the thing automatically sort the list (by setting the "sort" option in the resource editor), rather than having to manually sort the list. The problem comes when I want to add a new file (and associated subitems) to the list. My idea was to use InsertItem to add the filename at the end of the list, and then SetItem to add the associated subitems. However, when I call InsertItem(), the control immediately resorts the list, so the item I just added is no longer where I put it; consequently, I don't know which item # to use in the call to SetItem().
Finally, the question: is there a way to temporarily disable the control's sorting until I finish adding the subitems?