从一个数据网格值插入另一个数据网格值C# [英] Insert from one to another datagrid values C#

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

问题描述

我需要在datagridRoba(数字,名称,bar_kod)上双击同一个forme,将这些值插入另一个具有相同列名的datagrid1(number,name,bar_kod)中



有些帮助吗?



我尝试过:



I need on same forme on double click from datagridRoba (number, name, bar_kod) to insert that values in another datagrid1 (number, name, bar_kod) with same column names

Some help?

What I have tried:

I need on same forme on double click from datagridRoba (number, name, bar_kod) to insert that values in another datagrid1 (number, name, bar_kod) with same column names

Some help?

推荐答案

int rownum = datagridView2.Rows.Add();
datagridView2.Item[rownum, 0] = datagridView1.Item[rownum, 0];
// etc





参见 DataGridViewRowCollection.Add方法(System.Windows.Forms)| Microsoft Docs [ ^ ]和 DataGridView.Item [String,Int32]属性(System.Windows.Forms)| Microsoft Docs [ ^ ]


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

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