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'm trying to do a simple OrderBy on a DynamicNodeList item, but I can't seem to pull this off.
Any knows how to do an OrderBy on a DynamicNodeList in Razor, say on createDate?
Thanks for your help,
Anthony
How about
var sortedItems = Items.Children.Where("Visible").OrderBy("createDate descending");
Hi Fuji,
Thanks, I refactored my code a bit. I got rid off the DynamicNodeList object and dit the ordering and filtering directly in my foreach loop like this:
foreach (var publication in publications.Where("publicationType == \"" + publicationtype + "\" && visible").OrderBy("createDate desc")){...}
thanks,
Does anybody know how to use .OrderBy for multiple properties, because .OrderBy("name, createDate") does not work and .OrderBy("name", "createDate") either. I use Umbraco 4.11.8
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
DynamicNodeList OrderBy
Hi,
I'm trying to do a simple OrderBy on a DynamicNodeList item, but I can't seem to pull this off.
Any knows how to do an OrderBy on a DynamicNodeList in Razor, say on createDate?
Thanks for your help,
Anthony
How about
Hi Fuji,
Thanks, I refactored my code a bit. I got rid off the DynamicNodeList object and dit the ordering and filtering directly in my foreach loop like this:
foreach (var publication in publications.Where("publicationType == \"" + publicationtype + "\" && visible").OrderBy("createDate desc"))
{
...
}
thanks,
Anthony
Does anybody know how to use .OrderBy for multiple properties, because .OrderBy("name, createDate") does not work and .OrderBy("name", "createDate") either. I use Umbraco 4.11.8
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.