In a .NET winforms application, how can I filter the data in my 2nd ComboBox
with respect to the value selected in my 1st ComboBox
?
views:
437answers:
2
A:
very cryptic question - however, if you are using webforms, you may want to try using the AutoPostback property on the combobox. You can then capture the combobox onChange event and place your filtering code there.
Jimbo
2010-02-13 14:54:42
+2
A:
Assuming WinForms:
combo2.DataSource = ((IEnumerable<string>)c.DataSource)
.Where(x => x == (string)combo1.SelectedValue);
Of course you might need to replace IEnumerable<string>
with IEnumerable<YOURTYPE>
.
Darin Dimitrov
2010-02-13 14:56:35
yes its a windows form
malou17
2010-02-13 16:13:02