IE Web TreeView Control - Sorting?

A

Aaron Corcoran

I posted this under the webcontrols area as well, however, I didn't
receive any feedback, so please pardon my redundant post.

Dear Group,

My coworker has been working on a project that uses the IE TreeView
control to mimic an explorer window. Everything works close to plan
except the way the control sorts the files. If you take the following
filenames as an example, sorted the way Windows Explorer would handle
them by name:

1-1 Warforged
1-2 Eberron is Wonderful
1-10 Pierce Lives
1-20 Go Vaddi Go
Chapter One
Chapter Two
Chapter Three

If you view these in the TreeView control, it sorts them
alphabetically, returning the results:

1-1 Warforged
1-10 Pierce Lives
1-2 Eberron is Wonderful
1-20 Go Vaddi Go
Chapter One
Chapter Two
Chapter Three

Is there an easy way to handle an alphanumeric search, similar to that
of Windows Explorer using the IE Web TreeView control? I do understand
that the users could put leading zeros on all of their numbers to get
the desired result; however, I'd like to alleviate that strain and aid
my coworker in this task. I'm sure there is a parsing routine I could
use as well, but again, this seems overly complex as though I might be
missing something.

Any assistance in the matter would be most helpful.

Thanks,
Aaron
 
A

Alvin Bruney [MVP - ASP.NET]

this isn't really supported, you would have to build that type of
functionality in or use some other container to perform the sort and force
the results back to the caller. for instance, you can automate excel and
force the data to a range and apply an excel sort thus returning the data.
that would get you what you want but consider the expense - COM interop to
appy a sort! It's not practical. writing this, another method comes to mind,
you can use a sortedlist and override the default sort to implement your
custom sort

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
 
A

Aaron Corcoran

Alvin,

Thank you for the feedback. It is comforting to know that it isn't
something I'm overlooking. However, I think the time comes to weight
the advantages of a quick fix (leading zero) to something similar to
what you mentioned above.

Thank you for your response!
Aaron
 

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top