Where I think that your problem lies is in the
button1_Click
event handler
Your Code:
private void button1_Click(object sender, EventArgs e)
{
OperatorsForm of = new OperatorsForm();
var checkedvalues = checkedListBox1.CheckedItems.Cast<string>().Select(s => "'" + s + "%'").ToArray();
string d = "LoadName LIKE " + string.Join(" or ", checkedvalues);
of.filter(d);
}
</string>
I have numbered the problem lines.
1. This creates a new instance of the Form, it does
not get a reference to the existing Form. Modify it as follows:
OperatorsForm of = this.FindForm() as OperatorsForm
2. After deleting line 1. of
no longer exists. What you do now depends on whether you have a filter(string filterString)
method(a.) or not (b.).
a. use this.filter(d);
b. use this.myBindingSource.Filter = d;
You should now be able to use
of.filter(d);
as before.
I hope that I have understood your problem and that this helps.
Good luck. :)