views:

60

answers:

2

I have a repository that contains all of my LINQ queries for this project that I am working on. I am able to get the LINQ results to a DataTable and bind that to a gridview for displaying the data. Now I need to make the gridview sortable. I have set AllowSorting="true" and I have the OnSort event handled in a routine in the codebehind. The program makes it into the sorting routine just fine.

Is manual sort my only option or is there an easier way to sort the gridview in the OnSort handler?

A: 

If you bind the GridView to a DataSourceControl then the sorting is taken care of for you. Otherwise you're stuck with doing it manually.

Jagd
A: 

I ended up solving this problem using this example from MSDN and attaching my own datatable, which was acquired through a LINQ Query in my repository.

Jacob Huggart