使用树状视图中的向上和向下箭头按钮并保存更改 [英] using arrow up and down buttons in a treeview and save the changes

查看:114
本文介绍了使用树状视图中的向上和向下箭头按钮并保存更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个绑定到sql table的树视图.在我的树视图的右侧,我有两个按钮,一个用于将节点向上移动,另一个用于将节点向下移动.我想保存节点的位置.例如,当我向上移动节点时,我希望将其保存在表中,以便下次打开网页时,节点的外观与我关闭页面时的外观相同.我的意思是用户进行更改,应该将其保存.

i have a treeview that is bound to sql table.and in the right hand side of my treeview i have two buttons ,one for move the nodes upper,and the other is to move them down.and it works perfectly.but i want to save the position of the nodes . for example when i move the node up ,i want that to be saved in my table,so that the next time i open the webpage, the appearance of the nodes be the same as when i closed my page.i mean when users make changes,it should be saved .

推荐答案

最好的方法是保存每个节点在数据库中的位置,并在检索数据时进行排序通过nodeposition列.如果NodePosition列为空,则按另一个适当的列排序.
The best way to do that is to save EVERY node''s position in the database, and when you retrieve the data, order by the nodeposition column. If the NodePosition column is null, order by another appropriate column.


这篇关于使用树状视图中的向上和向下箭头按钮并保存更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆