I have the following code and am trying to get the nodes grouped into 2's. I'm not sure how to change startNode.Children to achieve it. I've tried take(2) but this obviously stops after 2 !! So the outer foreach needs to group in 2's with those being displayed in the inner UL.
I think you are looking for the InGroupsOf functionality. The use of it is described on this documentation page. I use that to do something similar to what you are trying to achieve.
Razor groupby or take ?
I have the following code and am trying to get the nodes grouped into 2's. I'm not sure how to change startNode.Children to achieve it. I've tried take(2) but this obviously stops after 2 !! So the outer foreach needs to group in 2's with those being displayed in the inner UL.
This is the outcome I really want:
Hi,
I think you are looking for the InGroupsOf functionality. The use of it is described on this documentation page. I use that to do something similar to what you are trying to achieve.
/Carsten
is working on a reply...