This is a migrated thread and some comments may be shown as answers.

Expandable arrow not disappearing when child nodes have been removed?

1 Answer 65 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Johan
Top achievements
Rank 1
Johan asked on 10 Apr 2008, 01:12 PM
I use a TreeView where I instead of the "LoadOnDemand" property programmatically add Loading... sub-nodes. After fetching the requested data I populate my tree view by clearing the parent node's child nodes and then add all my received data.

My problem is that if no data has been received, the TreeView still displays my parent node as expandable.

        public void SetTreeNodes(Collection<NodeInformation> nodeInformation, string parentKey)  
        {  
            if (m_TreeNodes.ContainsKey(parentKey))  
            {  
                RadTreeNode parentNode = m_TreeNodes[parentKey];  
                foreach( RadTreeNode node in parentNode.Nodes)  
                {  
                    RemoveTreeNodeAndChildrenFromDictionary(node);  
                }  
                parentNode.Nodes.Clear();  
 
                foreach (NodeInformation information in nodeInformation)  
                {  
                    AddTreeNode(information, parentKey);  
                }  
            }  
        } 

I currently use 2007 Q3, is this a problem that has been addressed?

1 Answer, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 11 Apr 2008, 11:08 AM
Hi Johan,

Thank you for taking the time to write us.

If you are not setting the LoadOnDemand property of RadTreeView to true, there is nothing wrong with your code. What you are seeing is most likely the result of an issue in the VisibleCount property and the Clear method of RadTreeNodeCollection.

This issue has already been addressed and will not be present in the 2008 Q1 release, which is due next week.

Sincerely yours,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Treeview
Asked by
Johan
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Share this question
or