在C#中复制/粘贴/删除Datagridview [英] Datagridview Copy/Paste/Delete in C#

查看:145
本文介绍了在C#中复制/粘贴/删除Datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从datagridview行中复制某些单元格,然后复制到同一datagridview中的其他行.同样,将单元格从特定列复制到同一datagridview中的其他列.请提供示例代码,以帮助他人.在此先感谢

is it possible to copy certain cells from a datagridview row and copy to some other row .in the same datagridview. similarly copy cells from a particular column to some other column in the same datagridview . please somebody help by giving a sample code. thanks in advance

推荐答案

是的,这是可能的.最好在DataGridView上使用ContextMenuStrip来启动诸如复制,粘贴,插入,删除,清除等操作.

然后在MenuItem_Click例程中使用.SelectedCells,.SelectedColumns,.SelectedRows之类的控制.如果您遇到困难,请显示到目前为止的代码,我们将在那儿为您提供帮助.
Yes, that''s possible. It''s best to use a ContextMenuStrip on your DataGridView to initiate actions like Copy, Paste, Insert, Delete, Clear, etc.

Then use conrols like .SelectedCells, .SelectedColumns, .SelectedRows in your MenuItem_Click routine. If you''re stuck, show use your code so far and we''ll help you from there.


这篇关于在C#中复制/粘贴/删除Datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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