Re: Listview subitem sorting..
From: Vas (anonymous_at_discussions.microsoft.com)
Date: 03/15/04
- Next message: Jens Thiel: "Re: Strong names in Open Source"
- Previous message: Michael A. Covington: "Re: Chopping BIG Files"
- In reply to: Per Rollvang: "Re: Listview subitem sorting.."
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 14 Mar 2004 16:51:08 -0800
Use Parse to change the string
long a = long.Parse(((ListViewItem)x).SubItems[col].Text);
long b = long.Parse(((ListViewItem)y).SubItems[col].Text);
and use a conditional statement
(a < b) ? -1 : ((a > b) ? 1 : 0);
If you multiply the result of any of the tests by -1 you can sort ascending/descending.
Also test for white spaces, return 1 for x and -1 for y to keep the spaces down and out the way, I think.
- Next message: Jens Thiel: "Re: Strong names in Open Source"
- Previous message: Michael A. Covington: "Re: Chopping BIG Files"
- In reply to: Per Rollvang: "Re: Listview subitem sorting.."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|