开发者

How to get the value which is selected in gridview?

When I click on a row I should get the value o开发者_JS百科n which the user is clicked

How do I get that?


How about one of these event:

  • DataGridView.CellClick
  • DataGridView.CellContentClick
  • DataGridView.RowEnter


If I have understood you correctly, then you'll want the SelectedIndexChanged event.


If the grid's SelectionMode is set to FullRowSelect or FullHeaderSelect, you can get the selected row(s), using

DataGridView.SelectedRows

Then for each row you can use the Cells property to get the values.

There are a wide variety of ways to get at the underlying data set.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜