I’m working on a form that has a few data grid views that are populated from LINQ queries, no problem there it works as it should however that sorting does not work. After doing some reading its because LINQ results do not support sorting.
As I have the LINQ results already is there a way of copying the results into a dataset or datatable then binding the data grid view to that so sorting will work?
Thanks
EDIT:
Thanks to everyone for the answers, sadly I’m off on holiday for 2 weeks so cant try out and upvote the correct one. However when I return it will be on the top of my list
In the end I used bits from each option and a little tweak to get it to work with nullable fields.
First thing is getting the CopyToDataTable function into VB, this is done here
http://msdn.microsoft.com/en-us/library/bb669096.aspx
When I tried this it would fail if the column was nullable so I searched and found a mod to that code that would work. Here it is in full
Upvotes all round as they all would have worked I just took this option as it is neater