Results 1 to 4 of 4

Thread: sorting for a treeview add

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2015
    Posts
    102

    sorting for a treeview add

    Ok i have data comeing in " Disp=1 count=500 name=Myname" the name i need to collect these as an array as they come in and then sort them in ascending order by the Disp then add them to a treeview in proper order of course the disp is the order the count is the value of the names in myname and myname would be the Text seen in the node

  2. #2
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    868

    Re: sorting for a treeview add

    NBDB

    Do you have any code written so far?
    If so, post it ..
    .. and maybe you could show a screenshot too

    Spoo

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: sorting for a treeview add

    Why a TreeView? Sounds like a simple list, not a tree.

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: sorting for a treeview add

    Easiest way may be to traverse the level's nodes to find the next higher node and insert before that.

    Simple demo:

    Name:  sshot.png
Views: 338
Size:  4.2 KB

    Here I put the Disp value in parens as part of each Item's .Text just for illustration.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width