Data Layout Control
- 7 minutes to read
#Overview
You can bind a DataLayoutControl to any object via the DataLayoutControl.CurrentItem property. The control will automatically build a layout to edit this object's public properties.
This DataLayoutControl is bound to an object of the following class. (Note the attributes applied to the properties which define the arrangement of fields)
|
|
The DataLayoutControl is a data-bound version of its ancestor (the LayoutControl). The Data Layout Control extends its ancestor's layout functionality and introduces new data-aware features:
- Automatic layout generation when binding to an object.
- In-place editors for editing underlying data are chosen by a property's data type. You can apply a specific attribute to an object's properties to specify that this property must be edited using a multi-line text editor, password edit box, or text editor with a phone mask enabled.
- Ability to give display names to layout items via an attribute applied to an object's properties. These names are displayed within the layout items' labels.
- Ability to arrange in-place editors into groups and tabbed groups and name these groups via an attribute applied to an object's properties.
- Ability to specify the order of generated layout items via an attribute applied to an object's properties.
To bind a DataLayoutControl to an object, use the DataLayoutControl.CurrentItem property.
Editors used to edit the bound object's properties are generated based on the underlying property's data type:
Property's Data Type | Editor |
---|---|
String | Properties of the string type are edited by default, using the Text |
Boolean | Check |
Date |
Date |
Enumeration | Combo |
#Layout Generation Attributes
The Data Layout Control recognizes specific attributes applied to a bound object's properties. When building a layout, the Data Layout Control uses these attributes to give display names to layout items, specify the order of layout items, arrange items into groups and tabbed groups, etc.
Here is a list of supported attributes:
Attribute | Attribute's Parameter | Description |
---|---|---|
System. | Group | This parameter allows you to place a generated layout item into a group or tabbed group. If the parameter refers to a non-existing group, it will be automatically created. #Created Group TypeTo specify the type of the created group, enclose the group name in the following characters:
If a group name is not enclosed in any of these characters, the type of the created group is chosen as follows: If the created group's parent is a tabbed group, the created group's type will be of the Layout The type of the root group (the Data #Group Item OrientationYou can specify the orientation of items within the created group by adding the "|" and "-" characters to a group name. These specify the vertical and horizontal orientations of items respectively. If the orientation is not specified using these characters, the orientation will be as follows: If the created group is of the Layout The orientation of items within the root group (the Data #Nested GroupsTo place a layout item into a group that is nested in another group, the Group |
Name | If specified, this parameter defines a label for the generated layout item. If the parameter is omitted, the layout item's label is specified by the property's name. You can set the parameter to an empty string to hide the layout item's label. | |
Short | The same as the Name parameter. | |
Order | Specifies the order of the layout item among other layout items. If this attribute parameter is omitted, the layout item is pushed to the bottom of its parent group. | |
System. | Data | Supported data types:
|