ashishraj14
Programmer
I passed DataRow in the constructor of the form2 as follow
Public Sub New(ByVal row As DataRow)
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
Then on form load event of form2, I set the text property of textbox to value from datarow as follows
txtCustID.Text = drw("Cust_ID")
When I edited value in the textbox, the changes where written back to the DataGrid. How it could happen, even though I passed row ByVal and not by ByRef?
Secondly, I tried binding DataRow to TextBox as follow
txtCustID.DataBindings.Add("Text", drw, "Cust_ID")
But, it resulted in error: "Cannot bind to property or coulmn Cust_ID on DataSource"
What am I doing wrong?
Thanks
Public Sub New(ByVal row As DataRow)
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
Then on form load event of form2, I set the text property of textbox to value from datarow as follows
txtCustID.Text = drw("Cust_ID")
When I edited value in the textbox, the changes where written back to the DataGrid. How it could happen, even though I passed row ByVal and not by ByRef?
Secondly, I tried binding DataRow to TextBox as follow
txtCustID.DataBindings.Add("Text", drw, "Cust_ID")
But, it resulted in error: "Cannot bind to property or coulmn Cust_ID on DataSource"
What am I doing wrong?
Thanks