简体   繁体   中英

DataGridView row_onclick event?

I have a DataGridView and I should handle an event when a row (or any cell of a row) is clicked, yet I can't find anything like this. Is there a way to do this other than having each individual cell a handler method?

You may try the SelectionChanged event of Datagridview.

You have to set the SelectionMode property to FullRowSelect and check any change in the above event.

If necessary, you can get the rowindex using Datagridview.CurrentCell.Rowindex too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM