data-binding from datagrid to text box with code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dim bm As BindingManagerBas

bm = Me.BindingContext(stok.MinNoGeciciDS, "MinNoGecici"

i fill the datagrid1 with this dataset als

when i click the datagrid1 i want to see dataset field(studentNo) on textbox1.tex

is there something to put the information on textbox

Private Sub DataGrid1_Navigate(ByVal sender As System.Object, ByVal ne As
System.Windows.Forms.NavigateEventArgs) Handles DataGrid1.Navigat

textbox1.Text = bm.Item("studentno"

End Su
 
Hi Bafidi,

this should be sufficient
bm = Me.BindingContext(stok.MinNoGeciciDS, "MinNoGecici")

textbox1.DataBindings.Add(New Binding("Text",
stok.MiniNoGeciciDS.Tables("MinNoGecici), "studentno"))


And remove than that manual setting of the textbox.

have yourself a look at typos etc,

Give it a try, and tell if it did work?

Cor
 
Back
Top