dcsimg
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: 95/98
Expertise: Beginner
May 2, 1999

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


TreeView Control

Question:
I would like to know how I can add, remove, and see if an item is in the TreeView control. For example:
Prism Pros
     4/30/99 7:39AM
     4/30/99 8:00AM
McFarley
     4/30/99 7:43AM
I want to find out if "Prism Pros" is already in the list.

Answer:
The main problem here is that you need a scheme to uniquely identify each node. If you are tied to a database, the counter or sequence feature (called AutoNumber in Access) can provide a unique number that you know can't occur twice. If you are working with date and time entries, as shown in your question, you can format the date and time as a long number, such as 990430-0739, and append it to a string containing the parent's ID. I've used this scheme a few times before, and it makes it very easy to determine where in the tree an item is.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date