Multi-Editor Rows
- 5 minutes to read
The vertical grid controls (VGridControl and PropertyGridControl) provide three types of rows for flexible data representation. They are covered in brief in the Rows Overview topic. This topic describes the features provided by multi-editor rows.
Multi-editor rows
Multi-editor rows (represented by the MultiEditorRow class) are capable of displaying several cells within each record (and thus several header cells). This means that multi-editor rows can display the data from several bound data fields when working in bound mode. If working in Unbound Mode such rows will display several header cells and the same number of data cells.
The data and header cells in multi-editor rows can be separated in one of two ways. The default way is to separate them using a vertical line. However, you can provide a custom string that will be painted between cells. This can be useful if you are displaying related data within the cells of a multi-editor row. For instance, if the area code for a telephone number and the number are displayed in separate cells of a multi-editor row, you can specify a hyphen string as the separator between them. Please see the next section in this topic for more information on the settings provided by multi-editor rows.
Multi-editor rows are used for two purposes. The first as explained above, is to display related information to make data more readable. For instance, displaying the height and weight of a person, the area code and telephone number, the date and place of birth, etc. The second purpose is to save screen space when displaying data from a large number of fields.
The image below shows the vertical grid control displaying data with the help of editor and multi-editor rows. You can see how using complex rows takes up less space and makes the data easier to read.
Note: like rows of other types, multi-editor rows can serve as the parents or children of other rows forming a hierarchical data structure within a vertical grid. Please see the Creating a Tree-Like Structure of Rows topic for details.
Features of Multi-editor rows
All the rows available in the XtraVerticalGrid have two sets of settings. The first set is derived from the BaseRow class and affects the appearance and behavior of rows. It includes such settings as expanded state, row height, row options, the appearance of data cells, visibility state, etc. See the BaseRow.Expanded, BaseRow.Height, BaseRow.OptionsRow, BaseRow.Appearance, BaseRow.MaxCaptionLineCount and BaseRow.Visible properties for details.
Multi-editor rows introduce two properties that specify the separator’s appearance: MultiEditorRow.SeparatorKind and MultiEditorRow.SeparatorString properties. The MultiEditorRow.SeparatorKind property specifies whether the separator is represented by a vertical line or string. If the separator is a string, its textual content can be specified using the MultiEditorRow.SeparatorString property.
Note: there are several ways in which the appearances of separators can be customized. The separators displayed within a row header panel are painted using the settings specified by the RowHeaderPanel property of the VGridControlBase.Appearance object. The separators displayed within data cells are painted using the settings specified by the RecordValue property of the VGridControlBase.Appearance object and by the BaseRow.Appearance property.
Separators can also be custom painted. For more information on custom painting, see the Custom Painting document.
The second set of settings provided by multi-editor rows give you the ability to customize rows based upon the data they display. Since a multi-editor row is capable of displaying several cells within each record, you will need to specify several header captions, several bound fields, etc. Thus, multi-editor rows own a collection of row item settings objects. Each object in this collection contains settings for an individual row item.
The collection of row item settings for multi-editor rows can be obtained via the MultiEditorRow.PropertiesCollection property. Each element in this collection is represented by an instance of the MultiEditorRowProperties class and enables the following settings to be specified:
Row Header Settings
- The row header’s caption - the RowProperties.Caption property.
- The index of the image displayed within a row header - the RowProperties.ImageIndex property.
- The width of the header cell - the MultiEditorRowProperties.Width property.
Data Settings
- The name of the bound data field - the RowProperties.FieldName property. (This isn’t used when working in Unbound Mode).
- The format of the values displayed within data cells - the RowProperties.Format property (the FormatInfo.FormatType and FormatInfo.FormatString properties). See the Formatting Values topic for details.
- The read-only state of data cells - the RowProperties.ReadOnly property.
- The editor used to display and edit cell values - the RowProperties.RowEdit property. Refer to the Assigning Editors to Multi-editor rows topic for more information.
- The value stored within a row cell (used in Unbound Mode only) - the RowProperties.Value property.
The image below illustrates the settings listed above:
Note: the MultiEditorRowProperties.Width property doesn’t specify the actual width of a header cell. The widths of header cells are set proportionally with respect to the MultiEditorRowProperties.Width property of each row item, provided their total width is equal to the vertical grid’s VGridControlBase.RowHeaderWidth property.
To access the settings of specific rows at design time use the Rows Page.