Creates a new EditorRow object with default settings.
NuGet Package: DevExpress.Win.VerticalGrid
Use this constructor to create a new row of the EditorRow type at runtime. The constructor initializes the created editor row with the default settings. If you need a new editor row to be created bound to a specific data field, you should use the constructor with the fieldName parameter.
You can use methods and properties of the newly created row object to adjust it as your application needs dictate: you can bind it to a data field, specify its name, caption, editor type, etc. The created editor row should be added to a row collection in order to be displayed. Row collections can be accessed via the VGridControlBase.Rows or the BaseRow.ChildRows property. These properties are represented by instances of the VGridRows object which provides methods to add and delete individual rows.
The example below demonstrates how to create an editor row at runtime using the default constructor. 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, binds it to the “HP“ data field and specifies an editor of the SpinEdit type for the row.
using DevExpress.XtraVerticalGrid; using DevExpress.XtraVerticalGrid.Rows; // creating a new editor row instance EditorRow newEditorRow = new EditorRow(); // assigning the name and caption to the created editor row newEditorRow.Properties.Caption = "HP"; newEditorRow.Properties.FieldName = "HP"; // binding the row to a data field newEditorRow.Name = "editorRow_HP"; // assigning the editor type 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);