April 9th, 1999, 04:34 AM
I am trying to build a program with tree views ( controls). I will like the items on the tree to be dynamically updated from a database. For example if my database has a field in a table called Name, and under name I have Jane, John, and Peter. I will like my tree to have as parent Name, and child Jane John and Peter. So if Peter is removed from the database, The tree removes Pter from its listHow can I do this. My Database is an SQL Server. Can anyone please help !
Milton
EzehM@dionecorp.com
Rob Woodruff
April 12th, 1999, 09:30 AM
You will need to post a user-defined message to the tree control whenever the database is updated - the message needs to contain some information so that it can then find the correct tree item to update. You then need to lookup the tree item to refresh and reload the data for that node. Another method which I like better is to indicate that the tree is out of date (via a status pane) and allow the user to refresh the tree. I like to use the context menu, add a refresh item to it, and refresh the entire tree whenever the user elects to refresh the data.
If You steel need a help in TreeView please E-mail me to khanykov@mail.ru