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
Hello,
Is it possible to sort a List of Nodes by its CreateDate so that I have the Nodes listed from the most recent to the oldest (I'm using Visual Studio)?
Thanks
In XSLT or?
If yes, then something like this should do it (from the top of my head):
<xsl:for-each select="$currentPage/node">
<xsl:sort select="@createDate" order="descending" />
<xsl:value-of select="@nodeName" />
</xsl:for-each>
I think that would work, but I need to do this in code :)
If you wanna do it in code behind I think this is the way to do it. If there is a better way please let me know!
Node parent = new Node(1070);Node[] nodes = new Node[parent.Children.Count];for (int i = 0; i < nodes.Length; i++) nodes[i] = parent.Children[i];Array.Sort(nodes, delegate(Node node1, Node node2) { return node1.SortOrder.CompareTo(node2.SortOrder);});
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Sorting Nodes
Hello,
Is it possible to sort a List of Nodes by its CreateDate so that I have the Nodes listed from the most recent to the oldest (I'm using Visual Studio)?
Thanks
In XSLT or?
If yes, then something like this should do it (from the top of my head):
<xsl:for-each select="$currentPage/node">
<xsl:sort select="@createDate" order="descending" />
<xsl:value-of select="@nodeName" />
</xsl:for-each>
I think that would work, but I need to do this in code :)
If you wanna do it in code behind I think this is the way to do it. If there is a better way please let me know!
is working on a reply...