9,886,267 members (34,759 online)
Visit CodeProject.TV
Discuss CodeProject.TV
Sign in
Email
Password
Forgot your password?
Sign in using
home
articles
Chapters and Sections
>
Search
Latest Articles
Latest Tips/Tricks
Top Articles
Beginner Articles
Technical Blogs
Posting/Update Guidelines
Article Help Forum
Article Competition
Submit an article or tip
Post your Blog
quick answers
Ask a Question
View Unanswered Questions
View All Questions...
C# questions
ASP.NET questions
VB.NET questions
C#4.0 questions
C++ questions
discussions
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work & Training Issues
Design and Architecture
ASP.NET
JavaScript
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
Adobe Technologies
C#
Free Tools
Objective-C
Ruby On Rails
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
.NET Framework
Mobile
VS 11 & .NET 4.5
Sharepoint
Silverlight / WPF
Visual Basic
Web Development
Site Bugs / Suggestions
features
Component & Service Catalog
Competitions
News
The Insider Newsletter
Newsletter archive
Surveys
Product Showcase
Research Library
CodeProject Stuff
community
The Insider News
The Lounge
The Weird & The Wonderful
The Soapbox
Press Releases
Who's Who
Most Valuable Professionals
Company Listings
Non-English Language
>
General Indian Topics
General Chinese Topics
help
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
Site Map
Advertise with us
Employment Opportunities
About Us
Search within:
Articles
Quick Answers
Messages
Product Catalog
Comments by brunofer2007 (Top 3 by date)
Deleted
brunofer2007
-
15 Jan '12 - 5:59
View
just replace the logical comparison "n.Text[0] < temp.Text[0]" with other comparison logical. It have to be a TreeNode property.
Deleted
brunofer2007
-
14 Sep '11 - 6:36
View
1 - Sometimes a TreeView doesn't have necessarily a datasource. The nodes could be added manually (that was my case). 2 - If you watch carefully the code, you see that recursive function it's only called when a node has childnodes: foreach (TreeNode n in node.ChildNodes) sort(n); the recursive function is called as many child nodes you have, so you can predict the number of iterations 3 - I'll explain this step to you: - temp variable is initialized to null. - for each child node: if the temp is null, temp = childnode. if temp != null, if the first character of childNode < fisrt character of Temp, temp = childNode - when you reach the end of for each statment, the Temp variable has the lowest start character node. - add that node to List "childs", this way the list will be filled alphabetically. - delete temp node from child node. - start all over again (the temp variable is set to null to store again the lowest start letter node). - this cycle stops when there are no more childnodes: while(node.ChildNodes.Count>0) - then, you simply add again the childnode in the node (alphabetically sorted): foreach (TreeNode a in childs) node.ChildNodes.Add(a); 4 - and finally, as I mention before, the sort() method for TreeView is not present on WebForms (ASP.NET).
Deleted
brunofer2007
-
12 Sep '11 - 4:21
View
Hello George, as you can see in the title, this solution is for ASP.NET TreeView control. The method you mentioned works fine in WinForms Controls, but it's not present on this WebForm control.
Advertise
|
Privacy
|
Mobile
Web02 | 2.6.130516.1 | Last Updated 1 Jan 1900
Copyright ©
CodeProject
, 1999-2013
All Rights Reserved.
Terms of Use
Layout:
fixed
|
fluid