Hi Team,
In the Telerik article for Custom Nodes in Treeview, the root node and the child nodes contain the same controls i.e image,label,line,button.
Please provide code for displaying different controls in the root node and child nodes. Eg: image,label,line,button in Root Node, TextBox in child node in level1 and checkbox in child node in level 2
Thanks,
Swarupa
6 Answers, 1 is accepted
Thank you for writing.
I have prepared a sample project for your convenience demonstrating how to create different custom nodes for the tree view levels. Due to RadTreeView virtualization, note that the IsCompatible method controls for which level the node element is applicable.
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik by Progress

Hi Dess,
Thankyou so much for your quick response.
You have given an apt solution for my query. Its working perfect.
Thankyou so much..
Regards,
Swarupa

Hi Dess,
Thank you for the solution. I am facing trouble in binding data to the Treeview. I have three user controls in my solution.
The treeview has three levels of nodes. Level 0 nodes contain ParentUserControl (contains two text boxes that will be filled dynamically from database) . Level 1 nodes contain ChildUserControl(data filled in the controls dynamically) and Level 3 nodes contain GrandChildUserControl(data filled in the controls dynamically) . The no of nodes of the treeview are decided dynamically. The data to be bound to the user controls come from the database dynamically. Please let me know the way to bind the data. Please find the sample screenshot of the output attached
Thanks ,
Swarupa
Thank you for writing back.
The Synchronize method of the custom TreeNodeContentElement is the appropriate place to synchronize your custom elements with the relevant DataBoundItem's information. Additional information is available here: http://docs.telerik.com/devtools/winforms/treeview/working-with-nodes/custom-nodes
I suppose that it may be necessary to expose public properties for each UserControl in order to access more easily the inner controls.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik by Progress

Hi Dess,
while expanding any node in the radtreeview (with usercontrols as nodes), the child node is first blinking at the top location of the treeview and then appearing at the correct location (i.e under the parent node).Please provide solution.
Thanks,
Swarupa
Thank you for writing back.
I am not familiar with the implementation of the UserControl that you have. However, note that using controls in tree view nodes may slow down the scrolling and will cause visual glitches as they do not support clipping. It is recommended to use only elements as it is demonstrated in the sample project. A better option would be using custom editors. Thus, you can construct the desired editor and activate it for the respective node.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik by Progress