Index of Currently Selected Row in DataGridView

后端 未结 12 1821
误落风尘
误落风尘 2020-11-28 22:46

It\'s that simple. How do I get the index of the currently selected Row of a DataGridView? I don\'t want the Row object, I want the in

12条回答
  •  青春惊慌失措
    2020-11-28 23:27

    Try DataGridView.CurrentCellAddress.

    Returns: A Point that represents the row and column indexes of the currently active cell.

    E.G. Select the first column and the fifth row, and you'll get back: Point( X=1, Y=5 )

提交回复
热议问题