Custom Nodes in Tree View

7 posts, 0 answers
  1. swarupa
    swarupa avatar
    11 posts
    Member since:
    Aug 2016

    Posted 04 Aug Link to this post

    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

  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 08 Aug Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. swarupa
    swarupa avatar
    11 posts
    Member since:
    Aug 2016

    Posted 08 Aug in reply to Dess Link to this post

    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

     

     

     

  5. swarupa
    swarupa avatar
    11 posts
    Member since:
    Aug 2016

    Posted 09 Aug in reply to Dess Link to this post

    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


  6. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 09 Aug Link to this post

    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.
  7. swarupa
    swarupa avatar
    11 posts
    Member since:
    Aug 2016

    Posted 10 Aug in reply to Dess Link to this post

    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

  8. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 15 Aug Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready