WPF C1TreeView and ElementHost issue

Posted by: sebastian-jn.k on 20 December 2022, 1:49 am EST

    • Post Options:
    • Link

    Posted 20 December 2022, 1:49 am EST - Updated 20 December 2022, 1:54 am EST

    C1.WPF 4.6.20222.770

    .NET 4.7


    we have a WPF c1TreeView hosted inside winform.

    The problem is that the painted lines aren’t centered positioned of the text.

    That looks not good, how do we can fix that?

    In wpf only context the positioning of text and painted lines is okay, see the sample picture.

    Sample attatched.

    thanks and greetings from germany.


  • Posted 20 December 2022, 11:15 pm EST

    Hi Sebastian,

    You can set the vertical alignment of the header content of the tree nodes, when C1TreeView control is added as a child of ElementHost class. Please refer to the following code for the same:

    var temp = FindControl<ContentControl>(treeViewItem as C1TreeViewItem, typeof(ContentControl), "Header");
    temp.VerticalAlignment = VerticalAlignment.Center;

    Kindly refer to the attached sample for full implementation. (See TreeViewTest_Mod.zip)

    Thanks & Regards,


Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels