如何从datagridview读取所选行的索引? [英] how to read the index of a selected row from the datagridview?
本文介绍了如何从datagridview读取所选行的索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在c#中获取数据网格视图中所选行的索引?如何从与所选行相关的网格数据集中知道隐藏列的值?
How to get the index of a selected row in the data grid view in c#? And how to know the value of a hidden column from the data set of the grid related to the selected row?
推荐答案
这些会有帮助吗?
https://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.selectedrows(v = vs.110).aspx [ ^ ]
https://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewband.index(v = vs.110).aspx [ ^ ]
Would these help?
https://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.selectedrows(v=vs.110).aspx[^]
https://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewband.index(v=vs.110).aspx[^]
int iddoctor = dataGridView1.CurrentCell.RowIndex;
int id =int.Parse( mydataDataSet6.Tables[0].Rows[iddoctor][0].ToString()
这篇关于如何从datagridview读取所选行的索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文