如何自定义两个 ComponentOne TreeView 组件之间的拖放操作?
我在 .NET 网页中有两个 TreeView 组件。我想将节点从一棵树拖放到另一棵树,但反之则不然。我还想将项目拖放到某个级别(最低级别),并将它们放在某个级别(第二低级别)。我已经在 Flex 中编写了自定义代码来对拖放进行类似的自定义,但我是 .NET 的新手,在这里真的没有任何线索。有人可以给我一些建议吗?这是一个原型,所以我只需要基本功能,但最终我将需要这些 drop 来执行对数据库的实时调用,以更新这些移动操作的数据。
I have two TreeView components in .NET web page. I want to drag-and-drop nodes from one tree to the other, but not vice versa. I also want to drag-and-drop items at a certain level (the lowest level), and drop them at a certain level (the second-lowest level). I have written custom code in Flex to do similar customization for drag-and-drop, but I am a newbie with .NET, and really have no clue here. Could someone please give me some advice. This is a prototype, so I only need basic functionality, but eventually I will need these drops to perform real-time calls to the database to update the data for these move operations.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
OnClientNodeDropped
事件处理程序在 JavaScript 中轻松完成此操作。如果拖动事件未达到所需级别,您还可以使用OnClientNodeDragStarted
处理程序来取消它们。我在这里发布了一个可下载的拖放树视图示例。以下是该项目的示例代码。You can do this pretty easily in JavaScript using the
OnClientNodeDropped
event handler. You can also use theOnClientNodeDragStarted
handler to cancel drag events if they are not at the desired level. I have posted a downloadable drag and drop treeview sample here. Below is the sample code from the project.