Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Duplicate Items in Treeview

Duplicate Items in Treeview

Scheduled Pinned Locked Moved C / C++ / MFC
questiondatabasealgorithmshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cE
    wrote on last edited by
    #1

    Hi, I have a problem with sorting duplicate items in a treeview. I retrive some info from a database and the resultset look something like this : Date....|City.....|Code --------------------------- 20041012|London...|123 20041012|London...|456 20041012|New York.|763 20041013|Boston...|236 20041013|London...|983 20041012|Oslo.....|923 And I want the treeview to look like this : +20041012 ...+London ......+123 ......+456 ...+New York ......+763 ...+Oslo ......+923 +20041013 ...+Boston ......+236 ...+London ......+983 How can i put the correct nodes in the correct level and do this in a easy way? Tune In, Turn On, Drop Out

    I J 2 Replies Last reply
    0
    • C cE

      Hi, I have a problem with sorting duplicate items in a treeview. I retrive some info from a database and the resultset look something like this : Date....|City.....|Code --------------------------- 20041012|London...|123 20041012|London...|456 20041012|New York.|763 20041013|Boston...|236 20041013|London...|983 20041012|Oslo.....|923 And I want the treeview to look like this : +20041012 ...+London ......+123 ......+456 ...+New York ......+763 ...+Oslo ......+923 +20041013 ...+Boston ......+236 ...+London ......+983 How can i put the correct nodes in the correct level and do this in a easy way? Tune In, Turn On, Drop Out

      I Offline
      I Offline
      includeh10
      wrote on last edited by
      #2

      tree-view has a sorting function, it is good enough for your case. includeh10

      1 Reply Last reply
      0
      • C cE

        Hi, I have a problem with sorting duplicate items in a treeview. I retrive some info from a database and the resultset look something like this : Date....|City.....|Code --------------------------- 20041012|London...|123 20041012|London...|456 20041012|New York.|763 20041013|Boston...|236 20041013|London...|983 20041012|Oslo.....|923 And I want the treeview to look like this : +20041012 ...+London ......+123 ......+456 ...+New York ......+763 ...+Oslo ......+923 +20041013 ...+Boston ......+236 ...+London ......+983 How can i put the correct nodes in the correct level and do this in a easy way? Tune In, Turn On, Drop Out

        J Offline
        J Offline
        josephvan
        wrote on last edited by
        #3

        is the Itemtext, that's looks like +strTreeItems[0] ++strTreeItems[1] +++strTreeItems[2] +++strTreeItems[2] +++strTreeItems[2] +++strTreeItems[2] you can do it yourself i think~~~~~~~~~enjoy cheer up!!!!!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups