Treeview Refresh

  • Thread starter Thread starter Monkey via AccessMonster.com
  • Start date Start date
M

Monkey via AccessMonster.com

I have created a Treeview, (Countries (Parent), Cities (Child)), If I
delete a city by means of a cmd button I want the treeview to refresh not
showing the city I've deleted. I have used Treeview.Refresh but to no
avail, unless I have put it in the wrong place. Any help would be
appreciated.
 
You'll can use Me.treeviewName.Nodes("keyString").Remove

Alternatively, if you've made several changes and want to refresh the tree
entirely after all of them, you could reload the tree, using the same code
that you used to load it initially (and if you're not doing so already,
you'll need to clear all the existing nodes before reloading the tree so
that you don't get "duplicate key" errors - use the .Nodes.Clear method).

If you want to learn lots about Treeview controls, I recommend Alex
Dybenko's sample, available from
http://www.pointltd.com/Downloads/Details.asp?dlID=36

HTH,

Rob
 
Back
Top