C# Form Parent-Child ComboBoxes and DataSet, DataBinding, and BindingNavigator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tschroeder250
    New Member
    • Mar 2007
    • 5

    #1

    C# Form Parent-Child ComboBoxes and DataSet, DataBinding, and BindingNavigator

    Hello All,

    I am writing a form that allows maintenance of the fields of a table. Two of the controls on the form are comboboxes, where selecting a value in combobox A filters what appears in combobox B. The combo boxes are bound to separate tables (e.g. state and city tables).

    For example, A might be State, and B might be City. Select a State, and the City list changes.

    I have gotten most of it done, but I have run into some snags. Some additional details:

    1. The State and City values may be null, so I have added a row to the City table in my DataSet containing a new row for the blank option. I did this in my Load method along with Filling my TableAdapters.

    2. I have SelectedIndexCh anged for A implementing the code that updates B. This code sets a Filter on the BindingSource (selects for the selected State, and the null entry).

    Issue: When I navigate from record to record, instead of the "null" city appearing (if the database has a null), the first "real" value is selected instead.

    I have gone round and round on this, trying lots of different things, but I am pretty sure I am missing something obvious. It can't be too hard can it?

    Please help!

    Todd
Working...