就是这么简单。如何获取当前选择的索引Row
of a DataGridView
?我不想要Row
对象,我想要索引(0 .. n)。
有的是RowIndex http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.rowindex.aspx财产为CurrentCell http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcell.aspxDataGridView 的属性。
datagridview.CurrentCell.RowIndex
处理SelectionChanged http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.selectionchanged.aspx事件并找到所选行的索引,如上所示。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)