Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6803641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:22:09+00:00 2026-05-26T19:22:09+00:00

I have a GridView with an EntityDataSource. I want to filter the rows at

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:22:10+00:00Added an answer on May 26, 2026 at 7:22 pm

    Having a Enumerable<T> you can define a List<string> containing the list of strings you are looking for and then write something like:

    List<string> search = new List<string>();
                search.Add("string 1");
                search.Add("string 2");
    
                var query = from ex in YourEntities
                        where search.Contains(ex.Field)
                    select ex;
    

    query will 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:

    <asp:CustomExpression OnQuerying="FilterByStrings"></asp:CustomExpression>
    

    And then define in your code such method:

    protected void FilterByStrings(object sender, CustomExpressionEventArgs e)
    {
         List<string> search = new List<string>();
                    search.Add("string 1");
                    search.Add("string 2");
    
         e.Query = from ex in e.Query.Cast<YourEntity>()
                   where search.Contains(ex.Field)
                   select ex;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a gridview control which will show X amount of rows. I want to
I have gridview that I am using paging on. I want to pass along
I have a delete button in each row of GridView (component ASP.NET). I want
I have GridView that allows select. It takes data from EntityDataSource . How do
I have a gridview which should allow rows to be in edit mode. this
I use C# in ASP.NET 4. I have a GridView and an EntityDataSource for
I have GridView and I need HTML ENCODE all values being update using Event
I have a GridView that is bound to an Entity Framework object. I want
I have a gridview that shows (50)rows of data per page. I have the
I have a gridview and usercontrol on the page, I want to alter gridview

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.