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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:34:30+00:00 2026-05-31T12:34:30+00:00

My data table dt has columns are as below Name, Value, key, IsMarkets, IsBudgets,

  • 0

My data table dt has columns are as below

Name, Value, key, IsMarkets, IsBudgets, IsPrograms

I have 3 check boxes chkbxBudgetsSearch,chkbxMarketsSearch,chkbxProgramsSearch

I want dt to be filtered on following condition

if chkbxMarketsSearch.IsChecked == true
all rows with IsMarkets=True should be displayed

if chkbxBudgetsSearch.IsChecked == true
all rows with IsBudgets=True should be displayed

similarly for programs

and if both check boxes are clicked then
all rows with IsMarkets=True and IsBudgets=False / IsMarkets=False and IsBudgets=True
/ IsMarkets=True and IsBudgets=True should be displayed

Note : its need not be only IsMarkets=True and IsBudgets=True

Its close to union operation
Can anyone wrire linq for this ?

  • 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-31T12:34:31+00:00Added an answer on May 31, 2026 at 12:34 pm

    EDIT: Okay, now that the question has changed:

    var result = Enumerable.Empty<DataRow>();
    var linqTable = table.AsEnumerable();
    if (chkbxMarketsSearch.IsChecked)
    {
        results = results.Union(linqTable.Where(row => row.Field<bool>("IsMarkets"));
    }
    if (chkbxBudgetsSearch.IsChecked)
    {
        results = results.Union(linqTable.Where(row => row.Field<bool>("IsBudgets"));
    }
    if (chkbxProgramsSearch.IsChecked)
    {
        results = results.Union(linqTable.Where(row => row.Field<bool>("IsPrograms"));
    }
    // Probably best to call `ToList()` here before doing much more work...
    

    Note that if none of the checkboxes is ticked, you won’t get any results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table in my data base that has three columns: Screen, Icon,
I have data in the SQL 2005 table as below. Table Name: FilterData CategoryID
I have a data table which already has some values, plus it is getting
I'm using cakephp and trying to check if a table has data entered in
I have a problem. Imagine this data model: [Person] table has: PersonId, Name1 [Tag]
I have a table with around 6 million rows and has many columns with
I have a <code>rich:extendedDataTable</code>. Each row has a a4j:commandLink as below. Table Page: <a4j:commandLink
I have a table with 692256 number of rows ,which has data similar to
My table has a timestamp column named RowVer which LINQ maps to type System.Data.Linq.Binary.
I am displaying a scrolled data table in a web page. This table has

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.