How does Windows Explorer sort file names? Emulate this in table...

  • Thread starter Thread starter VMI
  • Start date Start date
V

VMI

I have a Windows datagrid whose column values are
(1,10,100,1000,101,10-1,103,11,1710,2). When the column's sorted (the
column's of type String), it'll sort this way
[1,10,100,1000,101,10-1,103,11,1710,2], which is wrong. But in Windows
Explorer, when there are files with these same names , Explorer will sort
them like this: [1,2,10,10-1,11,100,101,103,1000,1710], which is correct.

How can I emulate this Windows explorer sort in my column?

Thanks.
 
Hi,

A vague guess... you need something like a type inherited from System.String
where the CompareTo method would be overridden to implement the proper
sorting algorithm. Then, you should store object of this customized String
type in the table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top