Dear All,
I have some confusion on data binding between datagridview and textbox.
Issue Description:
I want to bind datatable's data in datagridview and textbox, and when I
clicked the datagridview row, then textbox would get corresponding data in
datagridview and show in textbox. My problem is when I added the new empty row and
then I clicked this row, but can't clear textbox, still remained last row data.
You can check my implementation as below. Thank in advance.
Private Sub InitCPN()
Me.dgvCPN.DataSource = Me._dsSFC.Tables("CPNInfo")
////Textbox binding datatable.
Me.txtSN2.DataBindings.Add("Text", Me._dsSFC.Tables("CPNInfo"), "SN2Pattern")
Me.txtSN3.DataBindings.Add("Text", Me._dsSFC.Tables("CPNInfo"), "SN3Pattern")
Me.txtSN4.DataBindings.Add("Text", Me._dsSFC.Tables("CPNInfo"), "SN4Pattern")