将数据从一个网格拖放到另一个网格 [英] Drag And Drop Data One Grid To Another

查看:145
本文介绍了将数据从一个网格拖放到另一个网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
这是我的一个问题,我在Win窗体DataGrid1和Datagrid2上有2个DataGridView.
我想从DataGrid2上的DataGrid1拖放选定的行数据.我的datagrid1与数据库绑定,而Datagrid2为空,我想从datagrid1复制数据.而且我还想临时删除那些我从datagrid1中选择的行.
在此先感谢

Hello To All,
Here IS my One Question I Have 2 DataGridView on my Win form DataGrid1 and Datagrid2.
I Want to Drag And Drop Selected Row Data From DataGrid1 on DataGrid2.My datagrid1 is Bound with Database and Datagrid2 is empty where i want to copy data from datagrid1. And i also want temporary remove those row which i Select from datagrid1 How It Can Possible.
Thanks In Advance

推荐答案

首先,阅读以下示例:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dodragdrop.aspx [ ^ ]
然后实现您自己的需求.
First, read the example in this:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dodragdrop.aspx[^]
and then, implement yourself requirement.


您可能想要研究的几个事件

DragEnter DragLeave

AllowDrop ------->真实

尝试处理这些,您可能会得到所需的

祝你好运.........
few events that you may like looking into are

DragEnter DragLeave

AllowDrop-------> true

try to handle these and you may get what you need

Best of luck..........


这篇关于将数据从一个网格拖放到另一个网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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