Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
I solved this issue by adding
[ListItems(4)]
attribute.
[CultureSpecific]
[Display(Name = "Items", GroupName = PropertyGroupNames.Content, Order = 20)]
[EditorDescriptor(EditorDescriptorType = typeof(AnswerListPropertyDescriptor))]
[ListItems(4)]
public virtual IList<AnswerBlock> Answers { get; set; }
This works.
I need to add only 4 elements in IList. How can I do that?
[CultureSpecific]
[Display(Name = "Items", GroupName = PropertyGroupNames.Content, Order = 20)]
[EditorDescriptor(EditorDescriptorType = typeof(AnswerListPropertyDescriptor))]
public virtual IList<AnswerBlock> Answers { get; set; }
I tried to use [MaxLength(4)] but its not working. Please help?