The code to remove the existing line on datagridview using a c#Unfortunately, this is an English language forum. Please post your questions and replies in English.
Cide to wipe the line on datagridview which contains an empty space using c#How was the grid populated in the first place?
DataSource
member of the grid, then just delete that item from the list or data source and the grid should update accordingly. This is the correct way to do things.DataSource
property, then you need to remove the desired item from that data source. How you do that depends on what that data source is. We don't know that, so we can't say much more.Remove
or RemoveAt
method of the Rows
collection to remove a specific row or the row at a specific index, e.g.// Remove the current row.
myDataGridView.Rows.Remove(myDataGridView.CurrentRow);
// Remove the first row.
myDataGridView.Rows.RemoveAt(0);