我想循环数据网格并在用户单击保存按钮时找到选定的行ro列值 [英] I want to loop the datagrid and find the selected row ro columns value when the user click the save button

查看:47
本文介绍了我想循环数据网格并在用户单击保存按钮时找到选定的行ro列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

        大家好,

·         Hi All,

我正在使用datagridview在加载表单时显示数据.

参加.

我想循环数据网格并在当用户单击保存按钮

我如何使用vb.net 2008?

任何人都有想法.

谢谢.

推荐答案

您可以使用LINQ提供DGV行的集合选中该列的...

You could use LINQ to provide a collection of DGV rows that have that column checked...

但是,我想指出一个更明显的方法,就是遍历所有行,因为这是您要的.

However, I think I'll just point out the more obvious way, which is to loop through the rows since this is what you are asking for.


For Each row as DataGridViewRow in DataGridView1.Rows
  If row.Cells("MyCheckBoxColumnName").Value = True Then
    'This is a roiw that is "selected" by the user. Do something with it.
  End If
Next


这篇关于我想循环数据网格并在用户单击保存按钮时找到选定的行ro列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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