维持Treeview状态 [英] Maintain Treeview state

查看:59
本文介绍了维持Treeview状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有人可以告诉我在c#中重新加载后如何维护treeview节点的状态(展开或折叠)吗?

预先感谢.

解决方案

您将需要在temporaray文件或数据库中写入树状视图状态,并在再次加载表单/程序时检索这些值.

这很容易保存状态,只需按照此处 [ ^ ],将状态存储在Dictionary对象,然后使用序列化 [ 解决方案

You will need to write treeview state in a temporaray file or the database and retrieve these values when the form / program is loaded again.


That''s simple to save it''s state, Just follow tha way HERE[^], Once you have stored state in Dictionary object then store that object permanantly using Serialization[^], Once page is loaded again, DeSerialize object back and Load tree view again from it.


这篇关于维持Treeview状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发语言最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆