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
Is it possible to sort nodes by createDate using NodeFactory?
Yes, most nodeFactory methods return arrays which you can sort with standard array sorting methods or you can use LINQ.
Sorry bud I think I am being a bit dumb here, but I can't get it work?
// Get the parent node Node myNode = new Node(1121); // Now get all the children Nodes SubPages = myNode.Children;
I tried .Sort() on SubPages but that isn't an option? To use LINQ do you mean install that LINQ add on class you created?
Just in case anyone else has this problem, my solution was to loop through the nodes and add the to a List<T> and then use a lambda expression
You can just do:
var subPages = myNode.Children.Cast<Node>().OrderBy(x => x.CreateDate);
Genius :) Thanks
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Sorting Nodes With NodeFactory?
Is it possible to sort nodes by createDate using NodeFactory?
Yes, most nodeFactory methods return arrays which you can sort with standard array sorting methods or you can use LINQ.
Sorry bud I think I am being a bit dumb here, but I can't get it work?
I tried .Sort() on SubPages but that isn't an option? To use LINQ do you mean install that LINQ add on class you created?
Just in case anyone else has this problem, my solution was to loop through the nodes and add the to a List<T> and then use a lambda expression
You can just do:
Genius :) Thanks
is working on a reply...