Solved

itemdata in Treeview?

Posted on 2004-11-01
398 Views
Last Modified: 2013-12-26
I am populating a treeview control from a database field and I would like to store an index like the itemdata in listbox fo rfuture reference. What is the equivalent to that in TV?
0
Question by:zachvaldez
    2 Comments
     
    LVL 27

    Expert Comment

    by:Dabas
    Hi zachvaldez,
    Since you probably are using a node object to add items to the tree, try using the node's Tag property for your itemdata

    Dabas
    0
     
    LVL 14

    Accepted Solution

    by:
    hi
    if ur index values are unique then u can keep index as Node key , but preceed it with a text
    that is
    '--------------------------------------------------------------
    '   here ":::" is used as a unique text put before ur index value
    'Also if u want to get it back just replace this ":::"
    '    Index=CLng(Replace(nd.Key,":::",""))
    '

    Dim nd as Node
    Set nd = TreeView1.Nodes.Add(, , ":::" & Your_Index_Number , "Node_Text")
    '----------------------------------------------------------------

    ;-)
    Shiju
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: MongoDB Object-Document Mapper for NodeJS

    NodeJS (JavaScript on the server) is awesome, but some developers get confused about NoSQL when it comes to working in Node with MongoDB (NoSQL database). Do you need a better explanation of how to use Node.js with MongoDB? The most popular choice is the Mongoose library.

    Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    934 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now