Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


itemdata in Treeview?

Posted on 2004-11-01
Medium Priority
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?
Question by:zachvaldez
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 27

Expert Comment

ID: 12469670
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

LVL 14

Accepted Solution

Shiju Sasidharan earned 500 total points
ID: 12470982
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")


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

610 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