简体   繁体   English

TreeView更新

[英]TreeView Update

I have a treeview control on an aspx page. 我在aspx页面上有一个treeview控件。 The data comes from database and I bind it to treeview control programmatically. 数据来自数据库,我以编程方式将其绑定到Treeview控件。 (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. 我也使用updatepanel而不刷新整个页面并扩展子节点,我当然使用的是topicTree_TreeNodePopulate事件。 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. 顺便说一句,我对Javascript没有太多的经验,所以我不能使用JavaScript。

您可以在绑定Tree View时或刷新TreeView时将TreeNode的Expand属性设置为“ false”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM