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 would like to build a query that would get all children of the parent nodes selected in a multitreepicker.
So if I had a treepicker that selects categories, how would I return a single collection of all proucts from all of the nodes selected.
Regards
Hi,
I think you could do something like this:
var allChildNodes = parentNodes.SelectMany(x => x.Children);
parentNodes is the list of selected items from the MultiNodeTreePicker.
-Joep
Perfect. Thankyou.
First pass of code.
@{ var parentNodes = Model.Value<IEnumerable<IPublishedContent>>("relatedCollections"); if(parentNodes != null ){ var productSelection = parentNodes.SelectMany(x => x.Children); foreach(var productItem in productSelection){ <p><a href="@productItem.Url">@productItem.Name</a></p> }}}
Where relatedCollections is the MultiNode TreePicker.
Gives the required collection.
Cheers :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How would I get all child nodes of selected nodes in treepicker as one selection
Hi I would like to build a query that would get all children of the parent nodes selected in a multitreepicker.
So if I had a treepicker that selects categories, how would I return a single collection of all proucts from all of the nodes selected.
Regards
Hi,
I think you could do something like this:
parentNodes is the list of selected items from the MultiNodeTreePicker.
-Joep
Perfect. Thankyou.
First pass of code.
Where relatedCollections is the MultiNode TreePicker.
Gives the required collection.
Cheers :)
is working on a reply...