How can I create a selector form component where the user can choose multiple options

Kentico Dev asked on July 6, 2020 19:36

I would like to create a custom form component for use in widgets in Kentico MVC 12.

I have followed the documentation as seen here and have been able to make a custom dropdown component with dynamic data. However, this technique only allows the user to select a single option. Is there a way to allow the user to select multiple options as seen in the mock-up below?

Specifically, how would the UI get bound to the backing property, in this case, a List<int> property.

Is this possible?

Image Text

Recent Answers


Brenden Kehren answered on July 6, 2020 20:45

The best setup is to use a UniSelector on a text field. This will allow you to use the "Multiple" option and store IDs in a comma-separated list. Then in your code, you parse out the long string into your List

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.