Try this: in your DataBuilder
class, have a function that returns a subset of your items based on your filter condition.
For example, in your DataBuilder
class:
public BindingList<TableSet> someTableSets()
{
BindingList<TableSet> someTableList = new BindingList<TableSet>();
foreach (TableSet TS in allTableSets)
if (TS.IsPopulated == true)
someTableList.Add(TS);
return someTableList;
}
Then, in your MainForm
, instead of setting the DataSource
to allTableSets
, set it equal to the result of the someTableSets()
function:
this.populatedTableSetsListBox.DataSource = dataBuilder.someTableSets();