I am using a "RadTreeView" control where I have declared an event which handles the formatting of the node and also have NodeExpandedChanged event.
The main purpose of the NodeFormatting event is to control the Expander image
private void tvwDocuments_NodeFormatting(object eventSender, TreeNodeFormattingEventArgs eventArgs) { RadTreeNode Node = eventArgs.Node; //Check if Node is the root node, else check if it has no children, and set expand/collapse state accordingly if (Node.Parent == null) { eventArgs.NodeElement.ExpanderElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed; //Collapsed hides the element completely, hidden just makes it not visible but maintains spacing for it } else if (Node.Nodes.Count == 0) { //Disable drawing of the sign image, then set its size to 0 so that the lines are drawn underneath. eventArgs.NodeElement.ExpanderElement.SignImage = null; eventArgs.NodeElement.ExpanderElement.SignSize = new Size(0, 0); }
In my application I have a tree that looks something like the attached image (Tree Structure.png). From the image it will be evident that all nodes are expanded.
The issue what I am facing is, when all nodes are expanded and when the very first node of the parent is collapsed; all the respective nodes "ExpanderImage" is blank. (please refer attached screenshot (UpdatedTreeStructure.png))
Hello, Nishant,
Since the product in this forum thread is not specified, it would be greatly appreciated if you can share what is the exact Telerik product that you are currently using. Thus, the product will be properly updated and the respective community will gladly assist you.