data-binding from datagrid to text box with code

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
 
C

Cor

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top