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

  • Home
  • SEARCH
  • 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 6213093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:38:05+00:00 2026-05-24T06:38:05+00:00

Currently, ASP.NET Dynamic Data Entities only supports filtering on boolean or Foreign Key relationships

  • 0

Currently, ASP.NET Dynamic Data Entities only supports filtering on boolean or Foreign Key relationships out-of-the-box

How would I implement a custom filter, based on a dropdown list of values to filter the rows by?

  • 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-24T06:38:05+00:00Added an answer on May 24, 2026 at 6:38 am

    I figured out a way to do this, so that it fits within the intended templating system that ASP.NET Dynamic Data uses

    Basically the problem with this is that we do not know at compile time what the underlying column that might be filtered on is, let alone what type or column name it is – the first clue that led me to the path to implementing a solution was that the Filter controls all have a method GetQueryable

    Unfortunately, this method works on an instance of IQueryable rather than IQueryable<T>, thus preventing us from being able to simply use standard LINQ operators. What we need is a way to dynamically create a predicate (or chain of predicates even – in this case however, all I wanted to do was to get the distinct entries and sort them), which we can then apply to the IQueryable

    Unfortunately, there is no out of the box implementation of Dynamic LINQ, thus we must use expression trees – the second hint of how to solve this problem is the fact the IQueryable object exposes a .Expressions collection

    What we need to do is create the expression tree to represent the predicate (for selecting distinct in this case) then attach it to the IQueryable and return it. This was certainly not an obvious, nor straight-forward task and I certainly did not find expression trees easy to understand but therein was how I solved the problem.

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

Sidebar

Related Questions

We currently do a fair amount or dynamic image generation of png's in ASP.NET
I am currently aware that ASP.NET 2.0 is out and about and that there
I want to output some dynamic data from an ASP.NET website to Excel. I
I've been looking into ASP.NET Dynamic Data and how it does scaffolding and routing.
How could I create a dynamic forum signature generator using ASP.NET MVC. I currently
I'm currenlty using Asp.Net Dynamic Data, with Linq to Sql, to create an simple
I'm trying to enter a little bit of HTML into an ASP.NET Dynamic Data
Currently ASP.NET MVC's OutputCache attribute has a huge downfall. If you want to cache
I am currently using asp.NET MVC to build a Content Management System parts of
I am currently using ASP.NET MVC 2.0 RC2, having recently moved from version 1.0.

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.