开发者

How to get the value which is selected in gridview?

开发者 https://www.devze.com 2023-02-13 08:46 出处:网络
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:

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

精彩评论

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

关注公众号