The problem is, the OrderBy seems to be treating StartDate as a string instead of a date - for example, March dates show up before May dates despite the "descending". Any tricks to make the OrderBy treat a datepicker value as a date?
Hmmm, this is odd. I'm running into the same issue again in a different partial view, where the sort order appears to be treating the datepicker property as a string. Any suggestions on how to fix this?
OrderBy datepicker property not working as expected
I have the following code:
The problem is, the OrderBy seems to be treating StartDate as a string instead of a date - for example, March dates show up before May dates despite the "descending". Any tricks to make the OrderBy treat a datepicker value as a date?
Hi Andrew,
Should be like this:
Hope that fixes it for you?
Jeavon
You could also improve your .Where slightly, e.g.
Jeavon
Oh, good Lord, how embarrassing.
And thanks for the syntax improvement; I didn't know you could parameterize that way!
No worries, with dynamics you have no idea what the problem is :-)
Hmmm, this is odd. I'm running into the same issue again in a different partial view, where the sort order appears to be treating the datepicker property as a string. Any suggestions on how to fix this?
If the data property you are ordering by is of data picker, then it should be ok. Could you post your new code snippet?
is working on a reply...