Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Sort This
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01471946
Message ID:
01471985
Views:
40
>>I have a Project object. On it is a property called QueryItems. QueryItems is a List containing this class:
>>
>
>>How do I do this?
>
>Something like this should work. You'll have to adjust it for your own code:
>
>
>List<csQueryItem> project = new List<csQueryItem>();
>
>project.Add(new csQueryItem("C7497A"));
>project.Add(new csQueryItem("A7025A"));
>project.Add(new csQueryItem("A6913A"));
>project.Add(new csQueryItem("A9918A"));
>
>var sortedProject = project.OrderBy(i => i.QueryString);
>
If Kevin wants Products first then it would probably need to be:
var sortedProject = project.OrderBy(i => !i.IsProduct).ThenBy(i => i.QueryString);
Previous
Reply
Map
View

Click here to load this message in the networking platform