3 Answers, 1 is accepted
Usually, a RadTreeNode is represented with a text for the node:
No nodes in RadTreeView:
One node (with text) in RadTreeView:
One selected node (without text) in RadTreeView:
Could you please give us some more details about the expectations you have regarding this placeholder? What is the exact design that you are looking for? Would it be possible to provide a sample screenshot of the exact requirement that you are trying to achieve? Thus, we would better understanding of the precise requirement and think about an appropriate solution.
Thank you in advance for your cooperation. I am looking forward to your reply.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Thank you for the provided clarification.
In order to show the expander for a node, this node should contain at least one child node. Hence, in the provided screenshot the "Search Folders" node actually has a RadTreeNode which text is "(Empty)".
One possible solution that I can suggest is to use the NodeFromatting event and customize the fore color (e.g. light gray) for the visual node element according to your custom requirements. Don't forget to reset the style settings for the rest of the nodes that don't meet the criteria for an empty node you have since RadTreeView uses virtualization. Additional information how to use the NodeFromatting event is available here: https://docs.telerik.com/devtools/winforms/controls/treeview/working-with-nodes/formatting-nodes
Another approach that may fit your needs is to create a custom node element with one additional element that shows the text for the placeholder. Then, in the Synchronzie method you can control whether this custom placeholder element (e.g. a LightVisualElement) will be visible or not according to the requirements you have for the empty node. A sample example for constructing custom nodes is demonstrated in this tutorial:
https://docs.telerik.com/devtools/winforms/controls/treeview/working-with-nodes/custom-nodes
Should you have further questions please let me know.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.