I have a 'BindingListView View' bound to a 'DataGridView' of Equin.ApplicationFramework
. According to the documents filtering is done as:
View.ApplyFilter(
delegate (SomeViewModel item)
{
return item.Code == textBox1.Text;
}
);
I need a filter method that can filter item.Code == 'SomeText'
regardless of type of items in the BindingListView
is there any way to achieve this? I've come up with
View.ApplyFilter(
delegate (object item)
{
return item.GetType().GetProperty("Code").GetValue(item).ToString() == textBox1.Text;
}
);
Unfortunately it does not work. I get compiler error:
cannot convert anonymous method to type 'delegate' because it is not a delegate type
I also tried the solution here no success.