Reputation: 17
In my project I want to limit creating some nodes.
The user can add or remove dynamic nodes and children. As in the above image, I have a parent called "screen" and a node called "program".
I have 3 objects called "videoObject","imageObject","textObject".
These are the rules I wish to apply:
I need bind a list to this treeview to store screen node programs and each program node child's properties.
How can I apply this rule to treeview?
Upvotes: 0
Views: 277
Reputation: 391
I'm assuming you created a Model for this ? you could create a
private int _hierarchy = 0
public int Hierarchy
{
get{return _hierarchy}
set{_hierarchy = value}
}
before creation you check the higherarchy of the parent.
meaning if the hierarchy is 2, then you cant add a child to it.
Upvotes: 0