This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15947|Reply: 1

[WinForm] C# winform in listview sorting

[Copy link]
Posted on 12/7/2017 9:37:55 AM | | | |
The solution in this article is the one in the link below. Thank you very much to the author of this article, bright:http://blog.163.com/shensc@126/blog/static/1312896522010614103538287/

I saw many solutions on the Internet (actually, it's just one, but it's reprinted and pasted, so it's useless. At the same time, so much code is actually useless (forgive me for swearing) (the solution to that method is like this https://support.microsoft.com/en-us/kb/319401). Finally, I found a solution on a NetEase blog.

Here is a plan to find out for yourself:

First, create a class: ListViewColumnSorter, inheriting from IComparer

The entire class code is as follows:

The header click event of the listview is as follows:
Okay, that's it




Previous:The earth is down, the earth is down
Next:Understanding before you get started with Hadoop
 Landlord| Posted on 12/7/2017 10:06:51 AM |
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com