Data Binding & Controls

  • Thread starter Thread starter Jeremy Cowles
  • Start date Start date
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
 
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.
 
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
 
Back
Top