需求:vb.net中,当点击datagridview1时,获取datagridview1中选中行的第二第四列的值
解决办法:单击DataGridView1事件里写以下代码:
'第二列值= DataGridView1.CurrentRow.Cells(1).Value
'第四列值= DataGridView1.CurrentRow.Cells(3).Value
本文介绍了一种在VB.NET中从DataGridView控件获取选中行特定列值的方法。通过简单的代码示例,演示了如何在单击事件中读取第二列和第四列的数据。
需求:vb.net中,当点击datagridview1时,获取datagridview1中选中行的第二第四列的值
解决办法:单击DataGridView1事件里写以下代码:
'第二列值= DataGridView1.CurrentRow.Cells(1).Value
'第四列值= DataGridView1.CurrentRow.Cells(3).Value

被折叠的 条评论
为什么被折叠?