Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I have a dynamic nodelist called newsitems. I output from this using the following:
@foreach (var newslistitem in newslist.Distinct()){
.. and it works great. But when outputting I need to order by the custom property called dateWritten.
Suggestions?
Hi Bo,
Have you tried to do something like this
@foreach (var newslistitem in newslist.Distinct().OrderBy("dateWritten")){ }
Hope this helps,
/Dennis
Thanks, but I have already tried this. It then casts this one in the log: http://cl.ly/453R2Q2u0A3Y
Okay what if you do something like this.
@foreach (var newslistitem in newslist.Distinct().OrderBy(x => x.GetPropertyValue<string>("dateWritten")){ }
If the dateWritten property is not at string then try change the type so it matched.
You are missing a ")" but even though I add this, then I still get an error. This time the error is http://cl.ly/312D0e2U400u
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Ordering a dynamic nodelist by custom property
Hi
I have a dynamic nodelist called newsitems. I output from this using the following:
@foreach (var newslistitem in newslist.Distinct()){
.. and it works great. But when outputting I need to order by the custom property called dateWritten.
Suggestions?
Hi Bo,
Have you tried to do something like this
Hope this helps,
/Dennis
Hi
Thanks, but I have already tried this. It then casts this one in the log: http://cl.ly/453R2Q2u0A3Y
Hi Bo,
Okay what if you do something like this.
If the dateWritten property is not at string then try change the type so it matched.
Hope this helps,
/Dennis
Hi
You are missing a ")" but even though I add this, then I still get an error. This time the error is http://cl.ly/312D0e2U400u
is working on a reply...