> Hello,
>
[quoted text clipped - 13 lines]
>
> Pascal
Hi Pascal,
Unless you seek help from people understanding French, please translate the error message to English.
Anyhow, DataGridView.Rows.RemoveAt(index) should work just fine. How do you create the DataGridView/Rows?
The code below works fine in VS 2005 and Orcas
DataGridView dataGridView1 = new DataGridView();
protected override void OnLoad(EventArgs e)
{
this.Controls.Add(dataGridView1);
dataGridView1.Columns.Add("Column", "Column");
dataGridView1.Rows.Add(3);
}
private void button1_Click(object sender, EventArgs e)
{
dataGridView1.Rows.RemoveAt(0);
}

Signature
Happy coding!
Morten Wennevik [C# MVP]
Pascal Cloup - 26 Jul 2007 14:29 GMT
Hi Morten,
the error message translation gives: "Impossible to suppress the new not
validated line", well
I found the problem. In fact, Remove or RemoveAt doesn't work with the last
row of a DataGridView!
something like :
myDataGRidView.Rows.RemoveAt( myDataGRidView.Rows.Count - 1);
generated an exception!
best regards
Pascal
>> Hello,
>>
[quoted text clipped - 36 lines]
> dataGridView1.Rows.RemoveAt(0);
> }
ClayB - 28 Jul 2007 09:54 GMT
If you do not want to see the AddNew row (the last row which is
initially empty), you can set
this.dataGridView1.AllowUserToAddRows = false;
==========
Clay Burch
Syncfusion, Inc.