Hi,
I have a list view report style. Im trying to sort by click on a header, and it works fine, but it sort only the items, and I would like to have ability to sort also subitems (like in Windows explorer when user click for example size of header). Can anybody give me a tip what should I do to achieve this??

regards
WojciechW.

Have you tried using the ListView_SortItems macro?

Ofcourse, and with it I can sort the ListView content, but only according to the Item - not SUBITEM, and this I would like to do

Reg.
WojciechW

It is possible to sort by subitem too. It all depends on the callback function that you send to the macro. If your callback function defines the relationship between Item1 and Item2 depending on the relationship between Subitem1 and Subitem2, you can sort by subitem. Can you post the code for the LVN_COLUMNCLICK notification of the ListView under the WM_NOTIFY message of the window procedure? Then I can get an idea on what you are currently doing.

Edit:
I will probably need the callback function you are using for comparison also.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.