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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:50:19+00:00 2026-05-13T00:50:19+00:00

Ok, I asked this question before, but deleted it as the way I went

  • 0

Ok, I asked this question before, but deleted it as the way I went about describing my problem was wrong.

Firstly, let me state that Im creating a .NET3.5 Winforms app using C# and Plinqo (Professional Linq to Objects) as my ORM. Here’s my situation: I have a DataGridview that is populated from a SortableBindingList<T> – in my case, formed from a List<Task> which is simply represented as follows:

public class Task {
    public long TaskID { get; set; }
    public string TaskDescription { get; set; }
    public enumPriority TaskPriority { get; set; }
    public DateTime DueDate { get; set; }
    public double PercentageComplete { get; set; }
}  

Now, I want to provide a Dialog to my user to allow him/her to Filter this list. I envision passing in a list of property names and associated DataType into the Dialog that I can use to populate a ComboBox. So the user will choose which property they want to query from the comboBox and based on the selection the appropriate comparers and UI control will be made available for the user to enter in thier criteria. Lastly, it will contain an AND/OR togglebutton at the end which the user can use to add additional criterion. Each criterion will be an object of type FilterItem as shown below:

public class FilterItem {
    public string MappedPropertyName { get; set; }
    public enumComparer Comparer { get; set; }
    public object FilterValue { get; set; }
    public enumOpertor Operator { get; set; }
}

After the user constructs his/her query, I intend to pass this as a List<FilterItem> back to my calling form, which can then iterate thru the list and allow me to filter the original List<Task>.

This is all fine, and something that I can put together with ease. But I want to make sure that the ACTUAL filter mechanism I go with is as strongly-typed as possible, and not using bulit up strings like in the Dynamic Query Library. (I used to do something similar previously with ADO.NET, DataViews and dynamically constructing a RowFilter string)

I’ve read up on Joseph Albahari’s PredicatBuilder and an article on tomasp.net, but I seem heavily confused with it and expression trees in general.

I sincerely seek your assistance in helping me better understand these concepts, and how to go about using it up so that my intended architecture can work with it.

Much appreciation!

  • 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-13T00:50:20+00:00Added an answer on May 13, 2026 at 12:50 am

    Additionally, I know I can do something like:

    private SortableBindingList<Task> GetSortedTaskList()
    {
            List<Task> list = new List<Task>();
            var query = DataUtil.GetUserTasks(xSys.Current.UserID);
            if (/*description condition met*/)
            {
                query = query.Where(x => x.TaskDescription.Contains(FilterDesc));
            }
            if (/*due date condition met*/)
            {
                query = query.Where(x => x.DueDate >= FilterDate);
            }
            if (/*priority condition met*/)
            {
                query = query.Where(x => x.TaskPriority == FilterPriority);
            }
    
        ...
    
            list = query.ToList();
            return new SortableBindingList<ArcTask>(list);
    }
    

    but this does not seem very scalable and ‘dynamic’.

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

Sidebar

Related Questions

I know this question has been asked before, but I ran into a problem.
This question has been asked before ( link ) but I have slightly different
I know this question has been asked a bit before. But looking around I
This has been asked before (question no. 308581) , but that particular question and
I know this specific question has been asked before , but I am not
It's quite possible a question like this has been asked before, but I can't
I asked this question before, Here however I think I presented the problem poorly,
(I asked this question in another way , and got some interesting responses but
i know this question might be asked before, but i want to make it
I've seen this question asked before but it seems that the answer may be

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.