This is unrelated to a previous question, so I thought it needed a new
topic.
I want the user to be able to select filters and then I want to
programmatically impose those filters on the datagridview's
DataSource.
For example, I currently have
private void form_Load(object sender, EventArgs e)
{
DataContext db = new DataContext(connString);
Table<TestDB> dbTable = db.GetTable<TestDB>();
var stuff = from stuff in dbTable where
(chkListFilterBox.CheckedItems.Contains(stuff.Property)) select stuff;
BindingSource myBindingSource = new BindingSource();
myBindingSource.DataSource = stuff;
dataGridViewSample.DataSource = myBindingSource;
}
Where it queries the dbTable with TestDB items for items with Property
selected by user in chkListFilterBox (a CheckedListBox)
Then I have to fill the dataGridView. First of all, is the code
correct, and second of all, how do I fill it?