Hide checkbox from parent only

Posted by: alex.corti on 11 October 2022, 8:53 pm EST

    • Post Options:
    • Link

    Posted 11 October 2022, 8:53 pm EST - Updated 11 October 2022, 8:58 pm EST

    Good morning,

    I’m trying to remove checkbox from parent node only.

    Into documentation I see is possible set chebox view for entire TreeView and not only for the node

    There is another solution?

    Thanks

    Cattura.png: file show actual result, but I want to remove checkboxex on red rounded nodes

    Cattura.png: is actual written code

  • Posted 11 October 2022, 8:53 pm EST

    Winform .NET Core 6.0 library

  • Posted 12 October 2022, 7:31 pm EST

    Hi Alex,

    Unfortunately, removing the CheckBox from only specific nodes is not directly possible. As a workaround, what you can do is create a Custom presenter to render the nodes for the TreeView. In the presenter, you can check whether you need to show the checkbox for the specific columns or not by associating a boolean flag with the Nodes (using the Tag property). Kindly refer to the attached sample showing the same implementation. In the sample, you will need to set the Tag property of the Parent Nodes to false, to hide their checkbox.

    Best Regards,

    Kartik

    C1TreeView_HideCheckBox.zip

  • Posted 13 October 2022, 1:07 am EST

    Hi Kartik,

    thanks for your example.

    I undestood your solution: I will apply it to our implementation (I need to test a field of the Tag (it’s an entity for me).

    Very useful

    Alex

Need extra support?

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

Learn More

Forum Channels