Hi,
I want to be able to create a custom sort order for a Sorted List.
Specifically, I have a grid which goes from A1 to H12. The default sort
gives me A10, A11, A1, A2 ... I would like to change it so that it first
sorts by the alphabetical character and then the number. I have figured out
that I need to use IComparer, but I can't figure how to set up IComparer.
Can anyone help?
Thanks!
Ethan 5 4661
6/19/2006
Advanced IComparer // Sorting on Multiple Values http://sholliday.spaces.live.com/blog/
"Ethan Strauss" <ethan dot strauss at Promega dot comwrote in message
news:O1**************@TK2MSFTNGP03.phx.gbl...
Hi,
I want to be able to create a custom sort order for a Sorted List.
Specifically, I have a grid which goes from A1 to H12. The default sort
gives me A10, A11, A1, A2 ... I would like to change it so that it first
sorts by the alphabetical character and then the number. I have figured
out
that I need to use IComparer, but I can't figure how to set up IComparer.
Can anyone help?
Thanks!
Ethan
On Mon, 15 Jan 2007 10:05:27 -0600, "Ethan Strauss" <ethan dot strauss
at Promega dot comwrote:
>Hi,
I want to be able to create a custom sort order for a Sorted List. Specifically, I have a grid which goes from A1 to H12. The default sort gives me A10, A11, A1, A2 ... I would like to change it so that it first sorts by the alphabetical character and then the number. I have figured out that I need to use IComparer, but I can't figure how to set up IComparer. Can anyone help? Thanks! Ethan
The simplest way may be to change the names of the grid. A01, A02,
A03 etc. will sort correctly.
rossum
Hi,
"sloan" <sl***@ipass.netwrote in message
news:uV*************@TK2MSFTNGP06.phx.gbl...
| 6/19/2006
| Advanced IComparer // Sorting on Multiple Values
|
| http://sholliday.spaces.live.com/blog/
Weird, when I try to open the page my IE 6 crash, which browser r u using?
In pseudo-code:
Split this into alpha and numeric components.
Split "Other" into alpha and numeric components.
int retval = thisAlpha.CompareTo(otherAlpha)
if retval <0 return retval
return int.parse(thisNumeric).compareto(int.parse(otherNu meric))
Basically, what you are doing is comparing the alpha parts first and if they
are equal, converting the numeric parts to integers and comparing them.
Mike.
"Ethan Strauss" <ethan dot strauss at Promega dot comwrote in message
news:O1**************@TK2MSFTNGP03.phx.gbl...
Hi,
I want to be able to create a custom sort order for a Sorted List.
Specifically, I have a grid which goes from A1 to H12. The default sort
gives me A10, A11, A1, A2 ... I would like to change it so that it first
sorts by the alphabetical character and then the number. I have figured
out that I need to use IComparer, but I can't figure how to set up
IComparer. Can anyone help?
Thanks!
Ethan
On Mon, 15 Jan 2007 19:46:24 +0100, Ignacio Machin ( .NET/ C# MVP )
<machin TA <"laceupsolutions.com>"wrote:
Hi,
"sloan" <sl***@ipass.netwrote in message
news:uV*************@TK2MSFTNGP06.phx.gbl...
| 6/19/2006
| Advanced IComparer // Sorting on Multiple Values
|
| http://sholliday.spaces.live.com/blog/
Weird, when I try to open the page my IE 6 crash, which browser r u
using?
Works fine in IE 7, Opera 9 and Firefox 2. At least today.
--
Happy Coding!
Morten Wennevik [C# MVP] This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ken R. |
last post by:
Hello all,
I am relatively new to python but I am having an issue with custom
sort functions..
I am trying to sort a list of lists or tuples with arbitrary ascending
or descending sorts. For...
|
by: Mike King |
last post by:
Is there a way to sort by element names in XSLT, but not in ascending or
descenting order but by elements that I specify?
<root>
<cat />
<dog />
<rabbit />
</root>
the sorted result tree
|
by: Marri Suliez |
last post by:
Has anyone found some documentation on how to properly subclass a ListBox
control and provide custom sorting (when the list items come from a
DataSource)?
The only way I can figure out how to do...
|
by: Suzanne |
last post by:
Hi all,
I'm reposting this message as I'm experiencing this problem more and
more frequently :
I really hope someone out there can help me as I've been tearing my
hair out on this one for a...
|
by: TM |
last post by:
I am using an access database in my vb.net application and it is tied to a
datagrid.
My problem is that the field I want to sort on is a text field, 5 characters
long, and it contains not only...
|
by: Wiktor Zychla [C# MVP] |
last post by:
Hello,
just two sad thoughts on GridView's custom paging support, the first one
rather general and second one rather specific.
First one: I really miss the DataGrid custom paging support with...
|
by: Emma Burrows |
last post by:
I have created a typed dataset in .Net 2.0 based on an Access database, and
set up various methods to retrieve specific data from the tables, etc (great
fun). However, I need to implement a custom...
|
by: Ambica Jain |
last post by:
Hi,
I want custom sorting on some of the columns in the datagrid. And i am able
to do the same by overriding MouseDown event. However, i need to rebind my
datatable to reflect the changes in...
|
by: Max Odendahl |
last post by:
Hi,
my own declared class has a stl::list as a member variable. I now need
access to those from the outside. Is a custom iterator for my class the best
solution for this and how to do this?
I...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
| |