On 16 Nov 2006, at 20:24, Greg Bowman wrote:
I'm not even sure if this can be done - a listbox column has
numeric values followed by text in parentheses. I can do a
numerical sort, but how would I have it first sort by number and
then alphabetically?
Example:
2 (abacus)
2 (calculator)
2 (zebra)
10 (abacus)
10(calculator)
10 (zebra)
I'm using comparerows, and I can't even imagine how I'd add in the
second sort criteria.
There's a number of ways to do it...
a) Have hidden (width 0) columns that hold the 2 parts of the sort,
use those two column's values in CompareRows.
b) Add an object via a tag that holds the two separate values that
make up the column, use that for CompareRows (I'd use a dictionary or
subclass thereof).
c) Have a separate array that gets sorted or separate dictionary that
you can reference based on a hidden unique value saved in a hidden
column, use that object for CompareRows.
d) Add a string to the row tag that has a "0000000000" + string
format so that the number is zero padded and therefore sortable as a
string.
You get the idea, but I'm assuming you're building the compound
string in the first place, so have the ability to save the two parts
somewhere for use in the sort.
--
Ian M. Jones
___________________________________
http://www.imijsoft.com
http://www.ianmjones.net (blog)
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>