How can I get the record of my selected row? What I would like is that when selecting a row this selection I return the record to then get its Id
and finally make an update in case of any modification.
Current code of the method to modify:
DataGridViewRow row = dataTabla.CurrentCell.OwningRow;
string value = row.Cells["Id"].Value.ToString();
I get the following error:
Reference to object not established as an instance of an object.
Only that error comes to me at the beginning I can not even enter the screen where the table is and I do not know why it is executed at the beginning if it should be executed when a row is selected. It is a method of type cellValueChanged
.