Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i wonder if someone has an example or an answer to why something like this doesn't work with a LINQ query

What I have tried:

C#
lv.Items.SortDescriptions.Clear();

SortDescription sd = new SortDescription(sortBy, direction);

lv.Items.SortDescriptions.Add(sd);

lv.Items.Refresh();


lv is bound to a LINQ queryresult

I found examples using other bindingsources and then I replaced those with LINQ (over SQL) and the listview doesn't show sorting. I understand that I can change the LINQ query to get a sorted result and then rebind - but should that really be nessecery ?

Thankful for suggestion
Posted
Updated 29-Aug-16 7:19am
v2
Comments
Maciej Los 29-Aug-16 13:21pm    
What doess your Linq query looks like? How the data are bounded to listview?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900