ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How to pre-select values in repeated MultiLookups
Title:
B
I
{code}
?
we are using MultiLookups in repeated sections, all works fine - page is working correctly, but Im not able to pre-select values when the page is loaded and model contains values for this entity View looks like: @for (int i = 0; i < Model.CommonAttributes.Count; i++) { <label name="CommonAttributes[@i].AttributeName" class="">@Model.CommonAttributes[i].AttributeName</label> <input type="hidden" name="CommonAttributes[@i].AttributeId" asp-for="CommonAttributes[i].AttributeId" /> @(Html.Awe().MultiLookup("CommonAttributes[" + @i+"].SelectedValues") .ClearButton(true) .HighlightChange(true) .SearchText("Select values") .GetItemsUrl(Url.Page("", "GetCommonAttributes", values: new {id = @Model.CommonAttributes[i].AttributeId })) .SearchUrl(Url.Page("", "SearchCommonAttributes", values: new {id = @Model.CommonAttributes[i].AttributeId })) .SelectedUrl(Url.Page("", "SelectedCommonAttributes", values: new {id = @Model.CommonAttributes[i].AttributeId }))) } OnGet server Method is prepared correct model "CommonAttributes" with all related data it is possible somehow overwrite on-load process for pre-selecting all MultiLookups ? thanks
Save Changes
Cancel
Erik
asked at 15 May 2021
please have a look here: https://demo.aspnetawesome.com/ListBinding
at 15 May 2021
Omu
works really well Thanks! Erik
at 15 May 2021
Erik
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK