I have a gridview ( loads fine with data from the DS ) - using Windows Form...
I'm trying to filter the gridview..
So if I use:
filtertext = "DeptID = '038'"
bindingsource.Filter = filterText;
I get all those in dept 038.
and if I Use:
filtertext = "DeptID = '038' AND Division = '01'"
bindingsource.Filter = filtertext
I get all those in Division 01 and in dept 038.
So far so good...
To continue:
filtertext = "DeptID = '038' AND Division = '03'"
bindingsource.filter = filtertext
I also get all those in division 03 and dept 038.
Now here's the catch..which fails all the time...
filtertext = "DeptID ='038' AND Division = '01' OR Division = '03'"
bindingsource.filter = filtertext.
This fail as it will give me everyone in all 5 divisions and ignore any filter syntaxes when trying to join like this.
The online help, doesn't help..and it says you can do this.. but it doesn't work.
I've tried rearranging the query in multiple ways with no luck.
Can I get a little help from anyone?
↧
Gridview filter syntax - C#
↧