Try our conversational search powered by Generative AI!

Generic property list - default value and required?



I'm using the new Generic PropertyList and it works great. However, I have some questions associated with it:

  1. How would you set a default value on a property which is defined on the model class? Like when you use SetDefaultValues?

  2. Is the Required-attribute supported for the properties?

Shout if you need a more detailed explanation of what I'm trying to achieve.


Aug 23, 2019 12:49


Two great questions:

  1. There is no easy way to do this, however, there is a blog post that'll take you through it:
  2. Yes, it supports Required

I should add, as per the Episerver documentation: "Episerver recommends using ContentArea and Blocks for lists of complex objects." With the continued improvements to EPiServer.Labs.BlockEnhancements you might consider using that instead (it allows inline block editing and smart publishing, see this blog post and this one as well).

Edited, Aug 23, 2019 16:26

Hi Jake,

And thanks for the answer!

However, I still think EPiServer should support default values for property lists out of the box. At least when none of the properties are complex types.

And as for blocks...they're great but BlockEnhancements is also still in Labs and should be used "as is". Think they should focus on getting things 100% done and ready.

Aug 27, 2019 8:15
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.