This is a migrated thread and some comments may be shown as answers.

TreeView set child not to accept children

1 Answer 82 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 08 Jun 2016, 09:04 PM

I have a situation where the data coming in because of the data coming from two separate tables can have the same ID. The ID is mapped to the NodeID (DataFieldID) of the tree view. Because of this I can have two nodes with the same id.  Instead of changing my data model converting the ID (int) to a ID (GUID) I would like to see if there is a mechanism in the TreeView where I can check to see if when adding a node check to see if the parent node is accepting a child or not. The below structure represents my tree structure.

 

When tree evaluates Node 75 with ParentID 37, I want it at the bottom node as it’s a folder vs the first 37 as it not a node that can have children.

NodeID  75

ParentID 37

 

 

 

NodeID 18

ParentID  null

 

       NodeID 69           

       ParentID  18 

 

       NodeID 56      

       ParentID 18

 

       NodeID  37 ß I don’t want it here

       Parent 18

             

 

       NodeID  1

       Parent 18

 

       NodeID  12

       Parent 18

      

       NodeID  26

       Parent 18

 

 

       NodeID 37  ß I want it here

       ParentID 18

        

 

Is there an event I can write code for to interrogate the node to see if I can add a child?

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 14 Jun 2016, 06:28 AM
Hello Ricardo,

I replied to your inquiry in the other thread you started in the ticketing system with the same subject. If you have other questions I suggest we continue the discussion in it, in order to avoid having duplicate threads. 

Regards,
Ivan Danchev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
TreeView
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or