Search In
Learn from 350 other Umbracians at the annual Umbraco Conference - CodeGarden '13. More than twenty high quality sessions, open spaces, hackathons and social events you'll remember. Not to be missed! Less than 25 tickets left - get yours now!
Hi there,
Is there an quick way to shuffle DynamicNodeList?
Cheers
mkariti
Got it! I used this:
Random r = new Random(); for (int n = pagesToList.Count() - 1; n > 0; --n) { int k = r.Next(n + 1); DynamicNode temp = pagesToList.Items[n]; pagesToList.Items[n] = pagesToList.Items[k]; pagesToList.Items[k] = temp; }