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 woud like to get value were selected from nuPickers.XmlCheckBoxPicker property and show on patial view. Do someone has example how to get it?
Thank you so much.
Assuming you're using ModelsBuilder you can do the following:
@foreach (var checkbox in Model.Content.*YourCheckboxPropertyHere*.AsPublishedContent()) { @checkbox.Name }
The .AsPublishedContent will convert the checkboxes into an IEnumerable
Thank you so much for your reply.
Hi Bhudsarin
It depends a little on what the source of your NuPickers Checkboxlist is...
Have a read of the different options here:
https://github.com/uComponents/nuPickers/wiki/Model
But essentially if your CheckboxList source is Umbraco Content, then
@{ var pickedItems = Model.Content.GetPropertyValue<Picker>("myNuPickerPropertyAlias"); <ul> @foreach (var item in pickedItems.AsPublishedContent()) { <li>@item.Name - @item.GetPropertyValue("title")</li> } </ul> }
making sure to add
@using nuPickers; @using nuPickers.Extensions;
at the top of your view...
regards
Marc
Update: sorry Alex didn't see you had already replied!
Thank you so much for your help. It's good explanations including source link.
No worries Marc, your answer was far more detailed.
Edit: Bhudsarin could you set Marc's reply as the solution?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to get value that was selected from nuPickers.XmlCheckBoxPicker property
Hi,
I woud like to get value were selected from nuPickers.XmlCheckBoxPicker property and show on patial view. Do someone has example how to get it?
Thank you so much.
Assuming you're using ModelsBuilder you can do the following:
The .AsPublishedContent will convert the checkboxes into an IEnumerable
Thank you so much for your reply.
Hi Bhudsarin
It depends a little on what the source of your NuPickers Checkboxlist is...
Have a read of the different options here:
https://github.com/uComponents/nuPickers/wiki/Model
But essentially if your CheckboxList source is Umbraco Content, then
making sure to add
at the top of your view...
regards
Marc
Update: sorry Alex didn't see you had already replied!
Thank you so much for your help. It's good explanations including source link.
No worries Marc, your answer was far more detailed.
Edit: Bhudsarin could you set Marc's reply as the solution?
is working on a reply...