When I try to do this:
var row = datagrid.CurrentRow;
name.RemoveAt(row);
(name is a list of strings)
This error appears "Cannot convert from 'System.Windows.Forms.DataGridViewRow' to 'int'"
I need to convert the row to int so I can delete it.
A DataGridViewRow
is not an integer but you can get the Index
of the row:
name.RemoveAt(row.Index);