DataGridView - in a real bind

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Take one DataGridView, add one column that contains cities, add another
that contains countries, add another that contains locales (states,
provinces, territories, etc.).

Now, make the Country and Locale columns ComboBox columns, and bind the
Country column to a Country BindingSource and the Locale column to a
Locale BindingSource.

Now run it. Pretend you are a user trying to add a new record. You
enter "San Diego" for the city, you select "United States" for the
Country. Then you go to select a state but the Locale column has every
locale of every country (almost 4,000 items), not just the 50 states.

Not good.

So, add an event handler that places a filter on the BindingSource to
show only locales belonging to the selected country whenever the user
clicks or enters a Locale cell in the DataGridView.

Run it again. The whole thing goes bananas. "Invalid cell" errors all
over the place. I think this is because the filter applies to the
*whole* Locale column, not just the ComboBox for the cell begin edited.
So if one of the rows contains Berlin but all the combo boxes in the
Locale column are filtered for United States, the validator gets angry.

So this is where I could use some help/advice. Is there any way to set
a filter for just the one cell (rather than the whole column)? Maybe
give that cell its own BindingSource?

A free box of my eternal gratitude to anyone who can help :)

-Dan

.



Relevant Pages

  • RfD: Internationalisation
    ... 2007-06-26 Updated rationale section, LOCALE@, and minor wordsmithing ... text files that can be edited and converted to another language ... in a similar way to the ANS word C", but returns a string identifier ... We use the word locale to mean the mixture of country, language, ...
    (comp.lang.forth)
  • Countries, States, and DataGridViews
    ... I'm trying to get two columns in a DataGridView to talk to each other. ... I want it to work so that, if the user selects a country, the locale ... have unique filters for the combo boxes in a column. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: How to obtain current Locale Language
    ... return the exact same country value that is contained in "PM_National", ... the country value in the default user locale object) and then executec ... It will return what is in PM_National, "iCountry" key. ... The default locale is "en_CA" (Canada), ...
    (comp.os.os2.programmer.misc)
  • Locale support for address labels
    ... labels on the search form to change based on what country you select. ... locale, and when I select UK from ddl, it passes en-uk locale to my ... Before I start typing out all the locales in my resx file, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Creating an Excel Automation Add-In using C#
    ... For Q1, I think this may be caused by the different locale, e.g. you set ... While if the formula has nothing to do with the cell change, then the excel ... recalculate the formula,e.g. ...
    (microsoft.public.dotnet.framework.interop)