Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CListCtrl no sorting

Status
Not open for further replies.

bubu123

Programmer
Joined
Sep 11, 2002
Messages
4
Location
RO
Hello!
I have a sdi project named Test with CTestView derived from CListView. How
can I make that the CListCtrl objetc of the CTestView to not sort the items
from the first column.
I put into CTestView::PreCreateWindow the line
cs.style=WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_SHOWSELALWAYS ;

but the CListCtrl object is sorting again. What should i do to disable the
sorting property of the CListCtrl object?

Thanks




 
One thing you could try is adding LVS_NOSORTHEADER to the style. That should disable the sorting by clicking on headers and keep your list unsorted.


Hope this helps!

--Rob
 
A ClistCtrl object is only sorted if either LVS_SORTASCENDING or LVS_SORTDESCENDING is attributed to it. Try
->ModifyStyle(LVS_SORTASCENDING | LVS_SORTDESCENDING,0);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top