Autogenerated Complex objects
Overview
A complex object is a property that consists of other simple properties or complex objects. Sitefinity CMS automatically generates editors for the them, depending on their types.
Complex object
The following screenshot displays a complex object with two properties of types string
and int
:

Nested complex objects
The following screenshot displays a complex object that has one property and another complex object, which in turn, has two properties:
Table with complex objects
You can have a custom widget that displays multiple complex objects in a table view with the ability to add or remove more entries such as the following:
In the screenshot above every row from the table displays the properties of one complex object. You can achieve this by using the TableView
attribute.
For more information see Customize autogenerated fields » TableView.
Display all properties
In cases when you have a lot of properties that cannot be displayed on one row, Sitefinity displays only the first 5 properties, you can edit the rest of the properties, by clicking
(Edit) in column MORE DETAILS. This will expand all the properties of the complex object in a new page.
You can control the number of columns displayed, using the TableView property.
For more information, see Customize autogenerated fields » TableView.
Display a nested complex object
If there is a complex object inside a complex object, you can edit its properties, by clicking
(Edit) in column INNER COMPLEX OBJECT. In case the inner complex object is in the detailed page of properties, there is a section Inner complex object that you can expand and view the properties.
Code sample
To insert a complex object, use the following code sample: