Resolved Sorting DataGridView

aaaron

Well-known member
Joined
Jan 23, 2011
Messages
219
Programming Experience
10+
This seems so simple a question I was sure I could find out myself be reading.
But I haven't.

So I experimented with, for example,
System.String.Compare and System.String.CompareOrdinal

I'm sorting a DataGridView using:
Handles DataGridView1.SortCompare

I want Beatles and BEatles to appear on adjecent rows.

Is that possble?
 
Do you have an example where you don't get the result you want, and how that should ideally sort?
 
Do you have an example where you don't get the result you want, and how that should ideally sort?

Using as something to try:
e.SortResult = System.String.Compare(e.CellValue1.ToString.ToLower, e.CellValue2.ToString.ToLower)
I get:

I got similar results without the ToLower and either System.String.Compare and System.String.CompareOrdinal

I'd like the top and bottom rows next to each other,

1641405307932.png
 
That image is sorting on Count, not Artist.
 

Latest posts

Back
Top