I have a GridView with an EntityDataSource.
I want to filter the rows at runtime using QueryExtender, by comparing it with multiple strings.
i.e., return only rows where a certain field is IN (‘string1’, ‘string2′, string3’)
Can someone point me towards an answer? Thanks.
Edit: I already know how to do this for one string, read from a control at runtime. But I’m unable to find anything on Google that demonstrates what I’m trying to achieve.
Having a
Enumerable<T>you can define aList<string>containing the list of strings you are looking for and then write something like:querywill have the items you are looking for.UPDATE
I am not familiar with the QueryExtender control but this MSDN tutorial suggests that you do the following:
Add a CustomExpressionFilter between the opening and closing tags of the QueryExtender control:
And then define in your code such method: