DataGridview选择了Rows索引? [英] DataGridview seleted Rows indexes ?
本文介绍了DataGridview选择了Rows索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的专业人士,
来自初学者的简单虚拟问题。
在我的应用程序中,用户将选择数据GridView中的行。
i想得到他选择的开始和结束索引。
Dear professionals,
simple dummy question from beginner.
in my app the user will select the rows in the data GridView.
i want to get the start and end indexes of his selection.
推荐答案
如下......
as below...
dim First_selected_row_Ind = dataGridView1.SelectedRows(0).Index
dim Last_selected_row_Ind = dataGridView1.SelectedRows(datagridview1.selectedrows.count-1).Index
快乐编码!
:)
Happy Coding!
:)
If DGV1.SelectedRows.Count > 0 Then
ENDROW = DGV1.SelectedRows(0).Index
STARTROW = DGV1.SelectedRows(DGV1.SelectedRows.Count - 1).Index
Dim TEMPROW As Integer
If ENDROW < STARTROW Then
TEMPROW = ENDROW
ENDROW = STARTROW
STARTROW = TEMPROW
End If
End If
i添加以上内容,因为选择可能是向上或向下....感谢你的帮助Mr.Meswania
i added the above as selection may be upward or downward....appreciate your help Mr.Meswania
这篇关于DataGridview选择了Rows索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文