views:

256

answers:

1
+1  Q: 

TreeView Update

Hi,

I have a treeview control on an aspx page. The data comes from database and I bind it to treeview control programmatically. (Parent-Child relationship in database of course)

Well and I added a textbox which I use to add new child under the selected node and it works also good but so as to see the new added node, I have to refresh and page and all the expanded nodes collapses naturally. How can I prevent that. I am also using updatepanel not to refresh whole page and to expand child nodes I am using topicTree_TreeNodePopulate event of course. When users add something under the selected node , without any refreshment or postback the recently added node should be seen right under the selected page.

Thanks in advance..

Btw I haven't much experience on Javascript so I can't do it with javascript.

+1  A: 

You can set the Expand property of TreeNode to "false" at the time of binding Tree View or whenever you are refreshing the TreeView.

Sachin Gaur