473,385 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sorting alphanumeric table column correctly

VMI
How can I sort a table column correctly when the table has values like "0",
"A1", "AA-1", "B21", "3C", 4-32A", "1", "11-1", 2-A", etc... The table will
then be loaded to a grid and that's when it'll have to sort correctly (when
clicking on the col. header).

Windows Explorer (in XP) seems to do this correctly when I sort files with
these names. In the column, I tried padding all values with 0's and the
sorting improved but it still wasn't correct.

Basically, I want to emulate the Windows XP file sorting.
Any help is appreciated.

Thanks.
Nov 16 '05 #1
1 5848
2 questions - are you trying to do this in a ListView? And what's the
expected order for the sample names you gave? I'm thinking 0, 1, 11-1, 2-A,
3C, 4-32A, A1, AA-1, B21. Is that the order you're looking for? In the
ListView, it's a fairly simple matter to define your own custom
ListViewSorter for special situations.

Thanks,
Michael C., MCDBA

"VMI" <vo******@yahoo.com> wrote in message
news:er*************@TK2MSFTNGP09.phx.gbl...
How can I sort a table column correctly when the table has values like "0", "A1", "AA-1", "B21", "3C", 4-32A", "1", "11-1", 2-A", etc... The table will then be loaded to a grid and that's when it'll have to sort correctly (when clicking on the col. header).

Windows Explorer (in XP) seems to do this correctly when I sort files with
these names. In the column, I tried padding all values with 0's and the
sorting improved but it still wasn't correct.

Basically, I want to emulate the Windows XP file sorting.
Any help is appreciated.

Thanks.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: jwedel_stolo | last post by:
Hi I'm creating a dataview "on the fly" in order to sort some data prior to writing out the information to a MS SQL table I have used two methods in order to determine the sort order of the...
7
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
3
by: Duy Lam | last post by:
I'm using collation SQL_Latin1_General_CP1_CI_AS and I need to sort a varchar field. There are some elements, however, that I want to come AFTER any alphabetic characters. Is there any character...
17
by: Matt Kruse | last post by:
I'm looking for the best JS/CSS solution to add functionality to tables. The only browser which needs to be supported is IE5.5+, but no activeX can be used. to be able to do: - Fixed header row...
3
by: Carlos | last post by:
Hi all, I currently have a Gridview that doess sorting correctly using several fields. However, I do have a checkbox field that when it is checked I do not know how to make its value to persist...
2
by: java_jazzy | last post by:
Hai , May I know how do we sort alphanumeric characters present in the same column. Thanking you, java_jazzy.
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
1
by: Chico Che | last post by:
I have a table that has a column varchar which contains numeric and alphanumeric values: Examples 1 10 11 29A 2000
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.