List Control LVS_SORTASCENDING and SetItemText 
Author Message
 List Control LVS_SORTASCENDING and SetItemText

I'm using a List Control with the LVS_SORTASCENDING style, in report view.
Items are correctly sorted when I first insert them. However, if I then use
SetItemText to change the label text (column 0), the item is not moved to
its correct new sorted position.

Is there any way to force the control to resort the items after editing the
label text (without calling SortItems which requires me to supply the
comparison function)?

Thanks
Jonathan



Mon, 07 Mar 2005 16:30:35 GMT  
 List Control LVS_SORTASCENDING and SetItemText
Try LVM_UPDATE, but I'm not sure. If that fails, you can always sort
explicitly with LVM_SORTITEMS, but you'll have to write a comparison
function.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> I'm using a List Control with the LVS_SORTASCENDING style, in report
view.
> Items are correctly sorted when I first insert them. However, if I
then use
> SetItemText to change the label text (column 0), the item is not moved
to
> its correct new sorted position.

> Is there any way to force the control to resort the items after
editing the
> label text (without calling SortItems which requires me to supply the
> comparison function)?

> Thanks
> Jonathan



Wed, 09 Mar 2005 05:56:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Want to handle massages of header list control of list control

2. Want to handle massages of header list control of list control

3. List View control and image lists

4. Results List - List Control field widths not sane

5. What is List Control and List View

6. image lists with list controls

7. Using a list box to edit labels in a list control

8. Scrolling event of list box and list view control

9. CListCtrl difference InsertItem() and SetItemText(0,...)

10. CListCtrl::SetItemText( ) problem

11. probelm with CListCtrl::SetItemText

12. using SetItemText to print a CString

 

 
Powered by phpBB® Forum Software