VB.net中的DataGridView获取当前被选中的行号
发布时间:2020-12-16 23:21:27 所属栏目:大数据 来源:网络整理
导读:Me.DataGridView1.CurrentCell.RowIndex 可以获取当前被选中的行号 可以定义一个静态全局的变量index 然后在SelectionChanged事件中为index=Me.DataGridView1.CurrentCell.RowIndex 这样就可以动态的在其他地方使用当前被选中的行号index了 me.DataGridView1
Me.DataGridView1.CurrentCell.RowIndex 可以获取当前被选中的行号 可以定义一个静态全局的变量index 然后在SelectionChanged事件中为index=Me.DataGridView1.CurrentCell.RowIndex 这样就可以动态的在其他地方使用当前被选中的行号index了 me.DataGridView1 .SelectedRows (0).Cells(2).Value 或者 me.DataGridView1 .SelectedRows (0).Cells("cloumns_name").Value 可以获取被选中行号中指定单元格的值 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |