Using query with where clause as datasource for combobox
-
I can easily bind a simple query to a combobox. But if I have a where clause in the query it doesn't work:
Complex DataBinding accepts as a data source either an IList or an IListSource.
Is there a way to overcome this? -
I can easily bind a simple query to a combobox. But if I have a where clause in the query it doesn't work:
Complex DataBinding accepts as a data source either an IList or an IListSource.
Is there a way to overcome this?Append your query with .ToList()
ComboBox1.DataSource = MyData.Where(Condition).ToList();
Then, it should work.Anurag Gandhi. http://www.gandhisoft.com Life is a computer program and every one is the programmer of his own life.
-
Append your query with .ToList()
ComboBox1.DataSource = MyData.Where(Condition).ToList();
Then, it should work.Anurag Gandhi. http://www.gandhisoft.com Life is a computer program and every one is the programmer of his own life.
Of course :)