Reputation: 31795
I have a binding source and it has a column called Description
and I want to exclude all rows that have their description set to 'x'.
I have tried:
bindingSource.Filter = "Description != ' + x;
That doesn't work. Does anyone know how to do a is not
comparison for the binding source's filter? I couldn't find any help on MSDN.
Upvotes: 1
Views: 4139
Reputation: 115741
Try <>
instead of !=
.
See this for more help:
http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx
Upvotes: 7
Reputation: 2488
Try this:
bindingSource.Filter = String.Format("Description != '{0}'", x);
One other thing to try is using <>
instead of !=
if the above does still not work.
Upvotes: 0