remove line in Datagridview?

Unfortunately, this is an English language forum. Please post your questions and replies in English.
 
It depends on how the data grid was populated. This is why @jmcilhinney was asking in post #4 above.

If you used a list or some kind of data source and bound it to the 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.

If you added rows to the data grid by iteratively calling methods on the grid row collection, then you'll need to delete the row from the row collection by calling a method on it.
 
I don't think we're going to get too far here because of the language barrier, so I'm just going to jump in a bit.

If you have bound data, i.e. you have set the 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.

If you are working with data directly in the grid, you can call the Remove or RemoveAt method of the Rows collection to remove a specific row or the row at a specific index, e.g.
C#:
// Remove the current row.
myDataGridView.Rows.Remove(myDataGridView.CurrentRow);

// Remove the first row.
myDataGridView.Rows.RemoveAt(0);
 
Back
Top Bottom