How can I delete dataGridView row on keyboard delete key press? c?

I use the DataGridView's KeyDown event, and in the handler determine if it was the Delete key that was pressed.

I use the DataGridView's KeyDown event, and in the handler determine if it was the Delete key that was pressed: if e. KeyCode == Keys.Delete... Then find which item/row to delete by getting the SelectedRows property if your DataGridView is on FullRowSelect or RowHeaderSelect mode, else you can determine the row with something like this: I = SelectedCells0. RowIndex then: DataGridView.Rowsi.

DataBoundItem You would then simply need to delete the corresponding record from the database, and possibly refresh the DataGridView depening on how its tied in...

Then you could use the SelectedRows property of your DataGridView.

I think CurrentRow would be appropriate – V4Vendetta Aug 25 at 11:53 That would depend upon your setting for MultiSelect. Msdn.microsoft. Com/en-us/library/… – Paul Aug 25 at 12:04 Its a different collection all together – V4Vendetta Aug 25 at 12:09 Well, the question is how to delete the SELECTED row.

If it is multiselect sooner or later, iterating over the SelectedRows rows would be the right decision, I think. – TheBlastOne Aug 25 at 23:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions