1

I've come across this situation way too many times to not create a unique framework to support it.

We usually display a bunch of data in grids or lists. The data usually revolves around a point of interest, let's assume Person for the sake of the example. The person has: 1. First Name 2. Last Name 3. Phone # 4. Email 5. Address (sub-entity) 6. Date Created 7. Date Modified

I need to create a dynamic filter that allows the user to pick and choose any of the above mentioned properties, and then enter a value (or alternatively pick from a set of values) and then filter data and sort it depending on their choice.

FogBugz has a great implementation of the same. It allows a user to pick almost any data point and filter data on it.

The framework should be intelligent enough to know that if you pick a State, it should allow user to pick multiple (checkbox list) or single state (dropdown) depending on how it is configured, instead of allowing user to type in values.

Is there anything that will allow me to do this? I am using ASP.NET MVC, C# and am open to Entity Framework, NHibernate or LINQ To SQL

I know Dynamic Data does something similar but don't know if there were other options.

Any ideas would be very appreciated.

Thank You, Anup

Anup Marwadi
  • 2,517
  • 4
  • 25
  • 42

1 Answers1

0

You could look at ExtJS Grid (commercial product) which supports all kinds of grid filtering. For a jquery grid you could start with jqGrid filtering. Most of the commerical MVC UI toolkits support filtering.

On the backend you would need to generate a dynamic query such as Dynamic LINQ Where Extension (C#).

I use the ExtJS grid with a modified version of the above LINQ extension with support for DateTime.

Community
  • 1
  • 1
Todd Smith
  • 17,084
  • 11
  • 59
  • 78