Forum Discussion
Text file option is probably the best option for me.
I think wItems method should work too but I find this being less suitable for our treeview which has many levels of children.
Thanks to everyone for helping me out. Really appreciate all your help.
Delete the node.
Refresh object properties.
Try selecting the node you just deleted.
Refresh again.
Check the current selection (it should be a property of the tree).
If it's not the one you just deleted, the deletion worked. (Unless it just moved it. If you want to be that sure, you'd need to do a node count or iterate through checking them.)
Thats how I do it with Delphi TreeViews. Works fine as tryting to select a node that doesn't exist doesn't cause it to throw and error for me. And even if it did, a simple try/catch should take care of it.
Related Content
- 2 years ago
Recent Discussions
- 4 minutes ago
- 24 hours ago