471,334 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Sorting a datagrid with Hyphen / Dash

Hi,

I have a dotNET Windows Forms DataGrid that contains a column'Part Number'

Problem is when I sort the grid on this column (eitherprogramatically or by clicking on the column header), thesequence is somthing like:

10-199
10-299
103-10
103-20
10-399

ie It seems to ignore the '-'.

Whereas, I want:
10-100
10-200
10-300
103-10
103-20

As the characters before the dash represent the part 'type' andthose after it represent the part 'size'

Is there a way of changing the sort parameters so that it does atrue comparison, rather than making its own decisions about howmy data is formatted...? I really don't want to get intocreating my own DataGrid with customised sort routines etc etcetc if I don't have to...

I don't think the source of the data or the code to generate thedatagrid is relevent, but if anyone believes it is, I canprovide further information on these.

Note: I CAN get round the problem by replacing the '-' with a '~'but that is not really a solution.

Any suggestions gratefully received.

Chris.
CJM170967LAT
--------------------------------
From: Chris Mayers

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>fGtKoxs8HU62/esOXeVmgw==</Id>
Jul 21 '05 #1
0 776

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Chris Mayers | last post: by
13 posts views Thread by Matt | last post: by
22 posts views Thread by stevenkobes | last post: by
reply views Thread by Chris Mayers via .NET 247 | last post: by
4 posts views Thread by deancarstens | last post: by
reply views Thread by Andreas Prilop | last post: by

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.