Groups | Blog | Home
all groups > dotnet windows forms databinding > september 2005 >

dotnet windows forms databinding : Filtering databound comboboxes



Doug Yoder
9/2/2005 10:04:45 AM
I have a form with several comboboxes, each of which I want to display all the
valid codes for a particular data field. I have all the comboboxes getting
their displaymember and valuemember from one table via a BindingSource. The
validcodes table lists one code per row, so if element #1 has 3 valid codes and
element #2 has two, there would be five rows in the table.

How can I filter the data given to each combobox, preferably without creating
separate BindingSources for each combobox? Can I create multiple queries in the
BindingSource and assign a specific query to a specific combobox?

Thanks in advance,
linhardt NO[at]SPAM aol.com
9/7/2005 4:10:05 PM
Doug,

If I understand you correctly, I would create several different
DataViews of the original data source and bind the DataViews to the
comboboxes. That way you can filter each DataView individually, but a
change in the underlying DataSet is propagated to all the comboboxes

-Paul

[quoted text, click to view]
AddThis Social Bookmark Button