I have 2 Trees and I would like to dynamically set the properties for certain nodes
Here are both my trees:
BorderColor="Silver" BorderWidth="1px" Height="400px" Width="100%" Padding="2px"
DragDropAcceptNames="treeviewnode,dragname" DragDropName="treeviewnode" EnableFullRowEvents="True"
OnDropJavascript="flyTreeView2_OnDrop" OnDragOverJavascript="flyTreeView2_OnDragOver"
RootDragDropAcceptNames="treeviewnode,dragname" FadeEffect="true" PostBackOnDropAccept="True"
PostBackOnSelect="true" OnInsertCallbackNodesFromValue="flyTreeView2_InsertCallbackNodesFromValue">
Padding="2px;3px;3px;1px" RowHeight="18px" />
BorderColor="Silver" BorderWidth="1px" Height="200px" Width="100%" Padding="2px"
DragDropAcceptNames="treeviewnode,dragname" DragDropName="treeviewnode" EnableFullRowEvents="True"
OnDropJavascript="flyTreeView2_OnDrop" OnDragOverJavascript="flyTreeView2_OnDragOver"
RootDragDropAcceptNames="treeviewnode,dragname" FadeEffect="true" PostBackOnDropAccept="True"
PostBackOnSelect="true" OnInsertCallbackNodesFromValue="flyTreeView2_InsertCallbackNodesFromValue">
Padding="2px;3px;3px;1px" RowHeight="18px" />
My Code Bind Code:
If ds.Tables(0).Rows.Count > 0 Then
' Call FlyTreeView.ConvertTabularDataToHierarchical method to convert into hierarchical datasource
Dim hierarchicalData As IHierarchicalEnumerable = NineRays.WebControls.FlyTreeView.ConvertTabularDataToHierarchical(ds, "Table", "UID", "Parent")
bindings.TextField = "Name"
bindings.ValueField = "UID"
Me.flyTreeView2.DataBindings.Add(bindings)
Me.flyTreeView1.DataBindings.Add(bindings)
' Bind the treeview
flyTreeView2.DataSource = hierarchicalData
flyTreeView2.DataBind()
flyTreeView1.DataSource = hierarchicalData
flyTreeView1.DataBind()
End If
Now this populates the trees perfectly from a Dataset. I was browsing the forums and found this :
What I am uncertain about is how I would set the properties for the nodes in the code. What I would like to do is
flyTreeView1 : Only allow nodes to be dragged onto the root, which are of type products.
flyTreeView2 : Only allow products from flyTreeView1 to be dragged onto Customers. Do not allow any nodes to be dragged or dropped within FlyTreeView2 unless it is a product being moved onto another customer.
I am just not sure how I go about setting this via code. I guess I need to take my treeview objects and iterate through all the nodes.
flyTreeView1 is arranged into:
-Route
--Run
---Customer
----Products
So I would like to set values for Products and if possible blanket apply values to everything else.
flyTreeView2 is arranged into:
-Products
It should just be a straight list without the ability to add any children.