TreeView add item
Posted on 2006-07-05
I want to use TreeView to create somekind of a very simple "document browser".
The TreeView starts with an empty "Root".
If user RIGHT-CLICK to a node, a "popup menu" will appear with this menu items :
- Add FOLDER
- Add FILE
If user choose Add FOLDER, it can have child nodes FILEs , but not FOLDER
If user choose ADD FILE, it can not have child node
At the end the structure will be something like this :
So, this structure below is not allowed because FOLDER may not have FOLDER as child node:
One more thing, how can I add "compound items" as node value ? For example: a FILE/FOLDER item is constructed from 2 values :
1. Node LABEL (example: Price List)
2. File (or folder) path (example: C:\DATA\Price_List.xls)
The TreeView will display only the "Node LABEL"
If user choose Delete from the popup menu, the node and all childs will be deleted.
Please if you can show me some codes how to make this scenario.
Thanks in advance.