I am having a DataGridView with 3 columns. Delete, User Name, Password. Delete column hosts a CheckBox, the other 2 are text. The DataGridView is named grid1.
I am trying to check if user has clicked the CheckBox field by using event handler. Problem is that I’m not sure what should I use to add handler to. Should I use grid.(...) or Delete.(...) and which property of should I use? Which event handler?
Try handling the DataGridView CellContentClick event:
You then need to test the column index to check it is your checkbox column.
You can get the checked state of each checkbox by inspecting the ‘value’ of each cell: