Login | Register   
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


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

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