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 8730239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:58:50+00:00 2026-06-13T08:58:50+00:00

DataView DV = DataTable.AsDataView(); for(int i=0; i<ConditonQueue.Count; i++) { DV.RowFilter = ConditonQueue.ElementAt(i); } Here

  • 0
DataView DV = DataTable.AsDataView();
for(int i=0; i<ConditonQueue.Count; i++)
{
     DV.RowFilter = ConditonQueue.ElementAt(i);
}

Here after the loop DV is filtered only for last element in ConditionQueue. How can I get DV with all filter condition on queue applied?
ConditonQueue.ElementAt(i) returns a string, which is a valid expression for RowFilter.

Combining all ConditonQueue.ElementAt(i) will not help in my scenario. I want to apply RowFilter each time.

As I need to do some calculation after each RowFilter. ANDing all conditions will not help.

Is there any other way to recreate the DV when RowFilter is applied in loop each time?

  • 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-06-13T08:58:51+00:00Added an answer on June 13, 2026 at 8:58 am

    Lots of assumption as your question is not clear. Try this

    DataView DV = DataTable.AsDataView();
    
    string[] filter = new string[ConditonQueue.Count];
    for(int i=0; i<ConditonQueue.Count; i++)
    {
         filter[i] =  ConditonQueue.ElementAt(i).ToString();
    }
    
    DV.RowFilter = String.Join(" AND ", filter); // filter1 AND filter2 AND ... AND filterN
    

    I don’t like your approach, am sorry to say but I think you have to update the DV so that the new filter is applied to already filtered view

    for(int i=0; i<ConditonQueue.Count; i++)
    {
         DV.RowFilter = ConditonQueue.ElementAt(i);
         DV = DV.ToTable().AsDataView();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to filter multiple rows in dataview. Here I used rowfilter. But, I
I want to convert dataview rowfilter value to datatable. I have a dataset with
It seems as if only DataSet , DataTable and DataView can be used as
I need to copy a dataview into a datatable. It seems like the only
How to filter DataView/DataTable by time? I have a table with datetime column inside
I have a DataGrid bout to the DataView property of a typed DataTable however
How to the select top n rows from a datatable/dataview in ASP.NET? Currently I
The DataView object doesn't have a Rows property like DataTable . How do I
i want to filter the data from a datatable using dataview row filter Datatable
I need a temporary DataTable or DataView made by LINQ to SQL result. but

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.