Advertisement

[x]
Attachment Details

Treeview sort in VB.NET 2005 2.0 framework

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.4
Tags: ,
I am writing an application in VB.NET 2005 framework 2.0. I have a treeview that I've named TV_UdxScans that is populated upon the Form_Load with the names of files from a folder search for files that start with "udx_" Concatenated with that is the date the file was created. Child node items are listed in descending order initially unless the user chooses otherwise.

The structure of the treeview is as follows:
+ ... parent node
- ... child node

+ Indexed
   - idx_297
+ My Unindexed
   + Batch 1
      - udx_309
   + Batch 2
      - udx_1248
      - udx_13
      - udx_ 28
+ Office Unindexed
   - udx_1293
   - udx_312

When the users right-click on a child node or the parent node, they will be able to sort ONLY the child nodes associated with the SelectedNode in ascending or descending order. I also made it so that if the user clicks on a node that contains no child nodes, then the computer beeps and it exits the procedure. Also, as the scans are added to the treeview list, they will be automatically sorted in descending order.

PROBLEM:
I can't get the stupid treeview to sort correctly! It will sort some in the correct order and then the rest is wrong.

EXAMPLE: (ascending sort sample)
udx_320.001     1/11/2007 1:17:09 PM
udx_321.001     1/11/2007 1:17:11 PM
udx_322.001     1/11/2007 1:17:14 PM
udx_323.001     1/11/2007 1:17:16 PM
udx_1269.001     12/1/2006 9:13:56 PM
udx_275.001     12/6/2006 10:26:36 AM
udx_281.001     12/6/2006 10:26:38 AM

I've tried using the .Sort() method and setting .Sorted = True and even the TreeViewNodeSorter. Nothing works! I'm just about to yank my hair out!!!

If someone can help me figure this out (please provide some code I can test with), you're a genius!
Related Solutions
Related Solutions
 
Loading Advertisement...
 

Rank: Sage

Expert Comment by Idle_Mind:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Author Comment by blitzzy:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Author Comment by blitzzy:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 

Rank: Sage

Expert Comment by Idle_Mind:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Author Comment by blitzzy:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Administrative Comment by Netminder:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Author Comment by blitzzy:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Accepted Solution by PAQ_Man:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
Loading Advertisement...
20080924-EE-VQP-41