BindingSource.AddNew Method

  • Thread starter Thread starter Thammarat charoenchai.
  • Start date Start date
T

Thammarat charoenchai.

After I use BindingSource.AddNew Method. (in my code is
OrderBindingSource.AddNew).

How can I set field value.

like


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
OrderBindingSource.AddNew()
DsOrder.Order("BillID") = "Test"
End Sub


this is error 'Property 'Item' is 'ReadOnly'

Thank you everyone.
 
If you are binding to a DataTable, then you can try code like:

Dim drv As DataRowView = CType(OrderBindingSource.AddNew(),
DataRowView)
drv("BillD") = "someValue"
drv.EndEdit()

=======================
Clay Burch
Syncfusion, Inc.
 
ClayB said:
If you are binding to a DataTable, then you can try code like:

Dim drv As DataRowView = CType(OrderBindingSource.AddNew(),
DataRowView)
drv("BillD") = "someValue"
drv.EndEdit()

=======================
Clay Burch
Syncfusion, Inc.

Thank you very much. :D
 
Back
Top