Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Which validator do I used to exclude SelectionElementBlock multiselect?


I only want to allow the required validator for a custom and remove multiselect as an Editor option for an element based on SelectionElementBlock.

[AvailableValidatorTypesAttribute(Include = new Type[] { typeof(RequiredValidator)},     Exclude = new Type[] { typeof(???)})]
Jan 04, 2019 23:16

I guess that you only want RequiredValidator for your custom element, and the validator should be removed for MultiSelect. If my understanding is true, so you probably can do it by customizing IValidationService.GetValidatorTypesForAnElementTypeInEditView that basically returns validators for a specific element. 

Jan 07, 2019 3:50

Yes, I want to remove "Allow multiple choices" from Edit mode.

I've tried to look at the validators in the element's default constructor but it's always null.

this.AllowMultiSelect = false;

            if (this.FormElement != null && this.FormElement.Validators != null && this.FormElement.Validators.Any())
                foreach (var validator in this.FormElement.Validators)


Jan 08, 2019 16:56

Hi Eric,

Allow multiple choices is a property of SelectionElementBlock, not a validator.

To hide that property from EditView. Go to Admin -> Content Type -> [Basic Element] Selection => Edit Property AllowMultiSelect as below

Edited, Feb 12, 2019 9:48
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.