Skip to main content

PGridEditorRow(String) Constructor

Initializes a new instance of the PGridEditorRow class with specified settings.

Namespace: DevExpress.XtraVerticalGrid.Rows

Assembly: DevExpress.XtraVerticalGrid.v22.1.dll

NuGet Package: DevExpress.Win.VerticalGrid

Declaration

public PGridEditorRow(
    string fieldName
)

Parameters

Name Type Description
fieldName String

A string value that specifies the name of the data field bound to the row being created. This value is assigned to the RowProperties.FieldName property.

Example

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