Data Binding & Controls

J

Jeremy Cowles

I have bound a combo box to a DataTable:
cbo.DataSource = m_dtLangs
cbo.DisplayMember = [field_name]
cbo.DisplayValue = [field_name]

ComboBox.DropDownStyle = DropDownList

When the selected item changes, I want the combobox to update a different
datatable with the currently selected value. So I have tried the following:

cbo.DataBindings.Add("Text", m_dtLabel, "printer_lang")
cbo.DataBindings.Add("SelectedText", m_dtLabel, "printer_lang")
cbo.DataBindings.Add("SelectedValue", m_dtLabel, "printer_lang")
cbo.DataBindings.Add("SelectedItem", m_dtLabel, "printer_lang")

None of these work (text / selectedText doesn't work because its a
DropDownList). I just can't seem to find the property where the actual value
is stored...

Any suggestions?

Framework 1.0
VS.NET 2K2

TIA,
Jeremy
 
J

Jeremy Cowles

cbo.SelectedValue

That doesn't work. When I try it, it throws an exception (option strict on),
because SelectedValue is a DataRowView.

With opt strict off, it sets the filed = "{System.DataRowView}", regardless
of the actual value.
 
J

Jeremy Cowles

Is this question really that difficult? This is the third time I have posted
this with no _accurate_ response... If anyone has links, books, help
topics, or anything related please post it. Any/all help is greatly
appreciated!

TIA,
Jeremy
 

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