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

Custom Nodes in Tree View

6 Answers 431 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
swarupa
Top achievements
Rank 1
swarupa asked on 04 Aug 2016, 01:28 PM

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

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Aug 2016, 11:01 AM
Hello Swarupa,

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
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
swarupa
Top achievements
Rank 1
answered on 08 Aug 2016, 12:36 PM

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

 

 

 

0
swarupa
Top achievements
Rank 1
answered on 09 Aug 2016, 10:14 AM

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


0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 09 Aug 2016, 10:40 AM
Hello 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
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
swarupa
Top achievements
Rank 1
answered on 10 Aug 2016, 12:17 PM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Aug 2016, 06:11 AM
Hello 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
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
Treeview
Asked by
swarupa
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
swarupa
Top achievements
Rank 1
Share this question
or