BindingSource.Filter doesn't work with '! = '

I have a binding source and it has a column named Description

and I want to exclude all rows for which their description is set to 'x'.

I tried:

bindingSource.Filter = "Description != ' + x;

      

This does not work. Does anyone know how to do a comparison is not

for an anchor source filter? I didn't find any help on MSDN.

+1


a source to share


2 answers


Try <>

instead !=

.

See additional information:



http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx

+7


a source


Try the following:

bindingSource.Filter = String.Format("Description != '{0}'", x);

      



Another try to try using <>

instead !=

if above still doesn't work.

0


a source







All Articles