C# – Filterable DataGrid with SubSonic

csubsonic

My goal is to create a DataGrid that uses a SubSonic object as its data source. The grid should have database-side paging and sorting, as well as columns that are intelligently filterable based on the data type of that column.

I actually have a fairly advanced prototype of the grid that does basically what it needs to. The problem is that in order to achieve the results, I had to include the SubSonic source in my solution, alter the generation templates for the data objects, and add entirely new templates for a super type that could serve paged, sorted, and filtered strongly typed collections. Adding those templates required that I also change the SubCommander code.

I'm dreading to upgrade SubSonic — the changes I've made WORK, but they are about as tightly coupled and brittle as they can be.

Is there a more sane approach to changing and adding generation templates?

Alternatively, is there an out of the box solution to my DataGrid problem that I've just over looked?

Edit:

As much as I'd love to use the newer version, I'm dealing with legacy code and I can't. I need a solution for SubSonic 2.x

Best Answer

This is more of a Subsonic 3 solution, but have you seen Rob's screencast using Subsonic3,T4, and the jquery grid to do pretty much most of what you are asking above (paging,sorting,filtering)

http://blog.wekeroad.com/subsonic/putting-the-ldquo-m-rdquo-back-in-mvc/