A newer version of this page is available. Switch to the current version.

EditorRow Class

Represents an regular data row within the grid control.

Namespace: DevExpress.XtraVerticalGrid.Rows

Assembly: DevExpress.XtraVerticalGrid.v19.2.dll

Declaration

public class EditorRow :
    BaseRow

Remarks

The EditorRow class is used to represent a row of the editor type in the VGridControlBase descendants. Editor rows are capable of displaying header and data cells - a single cell in each record. The data cell values of editor rows can be modified either by end-users (with the help of associated editors) or via code.

Being a direct descendant of the BaseRow class, the EditorRow inherits all its properties and methods. The EditorRow.Properties andEditorRow.XtraRowTypeIDproperties are overridden in the EditorRow class in order to provide access to a valid row settings object and return a proper numerical expression of the editor row type, respectively.

Additionally, this class introduces two overloaded variants of a constructor for editor rows. You can use these constructors to programmatically instantiate an editor row either with default settings or bound to a specific data field.

Examples

The example below demonstrates how to create an editor row at runtime and bind it to a specific data field using a constructor with the fieldName parameter. The new editor row is intended to represent and edit values of the HP (horse power) data field. For this purpose, an editor of the SpinEdit type is used for the row. The example code adjusts the created row and adds it to the grid's VGridControlBase.Rows collection.

During row adjustment the code sets the desired name and caption for the row and specifies an editor of the SpinEdit type for the row.

using DevExpress.XtraVerticalGrid;
using DevExpress.XtraVerticalGrid.Rows;

// creating a new editor row bound to a data field
EditorRow newEditorRow = new EditorRow("HP");

// assigning the name and caption to the created editor row
newEditorRow.Properties.Caption = "HP";
newEditorRow.Properties.FieldName = "HP";

// assigning the editor for the created editor row
newEditorRow.Properties.RowEdit = vGridControl1.RepositoryItems.Add("SpinEdit");

// appending the editor row to a collection of top level grid rows
vGridControl1.Rows.Add(newEditorRow);
See Also