First of all, I looked up this related question in here but the solution dataGridView1.Rows.Add()
doesn\'t work in my case.
In my Datagridview, I have
The Bound Datagridview has a problem that when you want to add your data programmatically it prevent it to add it directly. so the indirect and best way to add data is like this.. and remember never add data directly to datagridview programmatically because it create problem always, add data to your datasource instead :-)
code for VB.NET
Dim r As DataRow ( C# : Datarow r=new Datarow() below codes apply to C# also)
r = dataset.Tables(0).NewRow
r.Item("field1") = "2"
r.Item("field2") = "somevalue"
dataset.Tables(0).Rows.Add(r)
dataset.Tables(0).acceptchanges()
the update will goes as you do ever