Checkbox List
Alias: Umbraco.CheckBoxList
Returns: IEnumerable<string>
Displays a list of preset values as a list of checkbox controls. The text saved is an IEnumerable collection of the text values.
Unlike other property editors, the Option IDs are not directly accessible in Razor.
Data Type Definition Example
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F3701346516-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG1Byxw7XfiZAj8zDMCTD%252Fuploads%252Fgit-blob-798ccd419be2f139dd2d37a01ac7c63cfd813f32%252Fcheckbox-list-setup.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=b2586b1c&sv=1)
You can use dictionary items to translate the options in a Checkbox List property editor in a multilingual setup. For more details, see the Creating a Multilingual Site article.
Content Example
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F3701346516-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG1Byxw7XfiZAj8zDMCTD%252Fuploads%252Fgit-blob-091b76744a6b77968cb054d0907e149a99c3935b%252Fcheckbox-list-content.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=96badac0&sv=1)
MVC View Example
Without Modelsbuilder
With Modelsbuilder
Add values programmatically
See the example below to see how a value can be added or changed programmatically. To update a value of a property editor you need the Content Service.
The example below demonstrates how to add values programmatically using a Razor view. However, this is used for illustrative purposes only and is not the recommended method for production environments.
Although the use of a GUID is preferable, you can also use the numeric ID to get the page:
If Modelsbuilder is enabled you can get the alias of the desired property without using a magic string:
Last updated