C#Datagridview复选框 - 如何将多行发送到其他表单数据网格视图? [英] C# Datagridview Checkbox - How to send multiple rows to other form data grid view?

查看:564
本文介绍了C#Datagridview复选框 - 如何将多行发送到其他表单数据网格视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何从数据网格视图中选择行数据到另一个表格数据网格视图。



我有一个包含多个列和行的datagridview。第一列包含一个复选框。我希望用户能够选择多个复选框,然后单击确定按钮。例如,如果他们选择第1行和第2行中的复选框,则可以选择第1行和第2行中其他列的数据并将其传递到另一个表单数据网格视图中。



如何为多行执行此操作..?

Thanx ..!

Hi,

How do I get selected row data from data grid view to another form data grid view.

I have a datagridview with multiple columns and rows. The first column contains a checkbox. I want the user to be able to select multiple checkboxes and then click on OK button . For example if they select checkboxes in rows 1 and 2, the data from other columns in rows 1 and 2 can be selected and passed into another form data grid view..

How to do this for multiple rows..?
Thanx..!

推荐答案





i不知道这是否是这个问题的正确答案......但你可以尝试使用数组...存储二维数组中所选行的数据..



[] [] = {{row1col1,row1col2,row1col3},

{row2col1,row2col2, row2col3}};



然后将数组传递给下一个表单...然后你可以通过datagridview.add(数组元素)填充gridview ..希望这个帮助你...如果不是你可以尝试使用类似的机制: - )
Hi,

i don''t know whether this is a proper answer for this question...but u can try it using arrays..store the data of selected rows in 2 dimensional array..

[][] = { {"row1col1","row1col2","row1col3"},
{"row2col1","row2col2","row2col3"} };

then pass the array to the next form...Then u can fill the gridview by datagridview.add(array elements)..Hope this help u...if not u can try it using similar mechanism :-)


这篇关于C#Datagridview复选框 - 如何将多行发送到其他表单数据网格视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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