Adding rows to a databound DataGridView

tarunkapoor

Member
Joined
Apr 10, 2005
Messages
17
Programming Experience
3-5
Does any know how to add rows to a Data bound DataGridView.

1. the .rows.add method doesnt work because its for unbound datagridviews

Currently i am calling the addnew() method of the BindingSource connected to the DataGridView but this solution gets me into much more trouble.

Any other way out ?
 
adding rows

Adding rows to a dataset(DsTest1) bound to a datagrid?

VB.NET:
Dim tblTest As DataTable
tblTest = DsTest1.Tables("Test")
Dim drCurrent As DataRow
drCurrent = tblTest.NewRow()
drCurrent("Field1") = "something"
drCurrent("Field2") = 10000
tblTest.Rows.Add(drCurrent)

Is that any help?
 
Back
Top