hiya,
I have a datagridView.
There is a top level bindingSource, let's just call it "tblReturnsBindingSource"
tblReturnsBindingSource.datasource = tblReturnCollection1
Then, we have the "child" binding source...which is actually bound to the datagridview.
"tblReturnsProductsBindingSource"
tblReturnsProductsBindingSource.datamember = tblReturnProducts //THIS IS WHAT i NEED TO FILTER
tblReturnsProductsBindingSource.dataSource = tblReturnsBindingSource
At the moment, I simply populate the parentEntityCollection..And the IDE knows to bind the child entityCollection to the datagridView..
So far so good.
I now need to filter the "child" entity collection, namely the "tblReturnProducts".
I have some code that will tell me WHICH entities in the child entityCollection satisfy the filter conditions:
foreach (TblReturnEntity currReturnsEntity in tblReturnCollection1)
{
foreach (TblReturnProductsEntity currReturnsProduct in currReturnsEntity.TblReturnProducts)
{
if (currReturnsProduct.ReturnId == _selectedReturnId && currReturnsProduct.ReturnProductCondtionId == (int)cboReturnProductCondition.SelectedValue)
{
// What do I DO with these entities, so that the entiyCollection is successfully filtered? }
}
}
So, how do I successfully apply this filter?
PS, the reason that I can't simply filter the parent entityCollection is that the child entityColletion contains fields which are NOT part of the parent entityCollection.
I hope the above made sense.
many thanks,
yogi