Hi everyone!
Can anyone tell me how to get the column order after a user reorders the columns on the listview? I couldn't remove then add the columns, because my subitems will all be off. Thanks for any help!
I don't know whether this will help but MSDN has an entire article on sorting columns (including dates) which also has a section on sorting in ascending or descending order using a variable:
Thanks for the reply! But, sorting is not a problem. I have the 'allowcolumnreorder' property set to true for my listview. After a user reorders the columns, I want to be able to save the order so when they come back, the columns are in the order they put them in. There has to be something somewhere that has that order stored in it. Keep in mind the columns are not changing place in the column collection. They keep their same index number.
There is no method in the .NET listview control to get or set the column order once you have set AllowColumnReorder to true and the user has modified them.
However, in the following article someone has gone to the trouble of writing a class that uses the API to get the column order to serialize the listview. You should be able to extract the relevant information from that.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.