views:

1410

answers:

1

The setup:

I use Linq to Sql for my DAL and I extend the classes to encapsulate my CRUD methods (create, read, update, delete) for my BLL.

I don't just use the LinqDataSource because I usually have to run some other subroutines whenever I do my normal CRUD stuff (I know, this is pretty standard), so I use the ObjectDataSource controls to populate my GridViews.

The quandary:

Considering that GridViews don't sort when your ObjectDataSource's are IEnumerable, etc would it be better to just populate a DataTable from the Linq queries for all my SelectMethods? This would save me from having manually write a bunch of sorting code and I guess might possible save on overhead since I can just kill the big IEnumerable(of Entity) and just use the light DataTable of columns that I'm actually using.

The question:

What are the benefits/downfalls of both ways:

Way #1: Just use IEnumerbable(of Entity) with manual sorting code

Way #2: Populate DataTable from Linq query with what you need for GridView and use auto-sorting.

TIA!

A: 

I'm using Telerik Rad AJAX Controls and I figured out that if I used the NeedDataSource method for the RadGrid, you can use sorting without tons of extra custom code.

EdenMachine