Print Page | Close Window

Treeview sorting

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=16308
Printed Date: 27 November 2024 at 2:59am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Treeview sorting
Posted By: alen11
Subject: Treeview sorting
Date Posted: 28 February 2010 at 1:44am
Hey...any body know how do i sort the treeview node manually?

because beside i want to sort treeview by the alphabet i also want to sort treeviewnode by image

so please somebody help me,i use vb6..thanks



Replies:
Posted By: Baldur
Date Posted: 15 March 2010 at 12:13pm
You must than add the nodes in sorted order.


Posted By: ewink
Date Posted: 14 July 2010 at 3:31pm
Originally posted by Baldur Baldur wrote:

You must than add the nodes in sorted order.


Could you explain more details ??


I also want to sort based on image


-------------
Never GiveUP !!!


Posted By: b4db0yb4d
Date Posted: 09 October 2010 at 2:07pm
try this.................Wink
  
Dim tvn As Node
    Dim tvn2 As Node

   sName = 1

   Set tvn = TreeView1.Nodes(sName)
    tvn.Sorted = False

   chil = tvn.Children: If chil = 0 Then Exit Sub     ' if no children the exit
   Set tvn = tvn.Child.LastSibling
    
   For a = 1 To chil
    Set tvn2 = tvn
    
    Set tvn = tvn.Previous
    TreeView1.Nodes.Remove tvn2.Index
    
    'MsgBox tvn2
    
    TreeView1.Nodes.Add sName, 4, tvn2.Key, tvn2
   Next
i dnt knw it will help u or not Cry



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net