sorting a gridview using a objectdatasource which is linked to a list of objects

Hi all.
Well Im going round in circles a bit here.
Im having problems trying to implement sorting with a gridview using an ObjectDataSource.

The ObjectDataSource is linked to a method which returns a list of objects.
The query in the method actually returns a DataSet but I am manually looping through the rows in the DataTable and creating objects sticking them in a list. This way the gridview knows the type of object its getting back and I get all the columns shown in the interface and can use the smart tag to setup the gridview.

This is all great until I have to implement sorting. Since its a list it doesnt support list but it says DataSet does. So I tried linking the object data source directly to the DataSet and even the DataTable but not only do i loose the columns sorting doesnt work.

So my question is really:
1) Is it not possible to sort gridviews with ObjectDataSources?
2) Is there no way just to link the gridview to a dataset and get all the nice smart tag features and columns setup for you?

Thanks,
O
osionAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

amxCommented:
You can sort a gridview using an objectDataSource but you'll have to write it.

Its not so bad to write, the best example i could find is here:

http://www.dotnetjohn.com/articles.aspx?articleid=219
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
osionAuthor Commented:
Thanks amx,
That seems good.
All the best
D
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.