Databinding

  • Thread starter Jason and Cindy MacKenzie
  • Start date
J

Jason and Cindy MacKenzie

I have a simple windows forms app with databinding. Binding the textboxes
with Me.TextBox1.DataBindings.Add("Text", Child1, "Child.ChildFirstName")
seems quite straightforward.

My question is about how to data bind comboboxes so I can navigate through
records. I have this working with text boxes already.

My child dataset currently only contains data from 1 table with columns like
eye_colour that are integers and refer to a lookup table. Not sure if the
dataset needs to contain and join the required tables as well.

An tips or pointers to a tutorial would be really appreciated,

Jason MacKenzie
 
C

Cor

Hi Jason,

A sample
\\\
dim cma As CurrencyManager
combobox1.BeginUpdate()
combobox1.DisplayMember = "ident"
textbox1.DataBindings.Clear()
cma = CType(BindingContext(dataset1.Tables(0)), CurrencyManager)
textbox1.DataBindings.Add(New Binding("Text", dataset1.Tables(0),
"LastName"))
combobox1.DataSource = dataset1.Tables(0)
combobox1.EndUpdate()
///
I hope this helps,

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