windowsforms-devexpress-dot-xtraverticalgrid-dot-rows-dot-rowproperties-80e90454.md
Gets or sets the repository item that specifies the editor used to edit a row item cell values.
Namespace : DevExpress.XtraVerticalGrid.Rows
Assembly : DevExpress.XtraVerticalGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
[DefaultValue(null)]
public virtual RepositoryItem RowEdit { get; set; }
<DefaultValue(Nothing)>
Public Overridable Property RowEdit As RepositoryItem
| Type | Default | Description |
|---|---|---|
| RepositoryItem | null |
A RepositoryItem descendant.
|
Use the RowEdit property to assign an editor to a row item or to access the assigned editor’s settings. Note that the same editor can be bound to multiple rows, and can also be used in several controls. So, be careful when changing an editor’s settings, since they are automatically reflected in all elements and controls that use the given editor.
At design time, the RowEdit property provides a dialog that lists all available repository items. These are the items stored within the vertical grid control’s internal and external repositories. Please refer to The Repository Concept topic for details on the DevExpress repository technology.
At runtime, you can simply create the desired RepositoryItem descendant, customize its settings and assign it to the RowEdit property. The repository item must also be added to the grid’s internal repository (specified by the inherited EditorContainer.RepositoryItems property) or external repository (PersistentRepository). See In-place Editors to learn more.
You can also use the RowProperties.RowEditName property to bind an editor to the row. This property specifies the editor by its name. Note that the RowEdit and RowProperties.RowEditName property values are synchronized.
The example below demonstrates how to create a multi-editor row at runtime using the default constructor. The new multi-editor row is intended to represent and edit the values of two data fields ( MPG City and MPG Highway ) which contain information about the fuel efficiency of cars. For this purpose, two row items are created, adjusted and added to the row’s MultiEditorRow.PropertiesCollection. Since both bound fields are of an identical data type, both row items will use the same editor of the SpinEdit type to display and edit their data.
In the end of the example code’s execution, the multi-editor row containing two row items is added to the grid’s VGridControlBase.Rows collection.
using DevExpress.XtraVerticalGrid.Rows;
using DevExpress.XtraEditors.Repository;
// creating a new multi-editor row instance
MultiEditorRow newMultiEditorRow = new MultiEditorRow();
// assigning the name to the created multi-editor row
newMultiEditorRow.Name = "multiEditorRow_MPG";
// creating the first row item, specifying its name and binding it to a data field
MultiEditorRowProperties rowItem1 = newMultiEditorRow.PropertiesCollection.Add();
rowItem1.Caption = "MPG City";
rowItem1.FieldName = "MPGCity";
// creating the second row item bound to a data field and specifying its name
MultiEditorRowProperties rowItem2 = newMultiEditorRow.PropertiesCollection.AddProperties("MPGHighway");
rowItem2.Caption = "MPG Highway";
// assigning the same editor for the created row items
RepositoryItemSpinEdit riSpin = vGridControl1.RepositoryItems.Add("SpinEdit") as
RepositoryItemSpinEdit;
rowItem1.RowEdit = riSpin;
rowItem2.RowEdit = riSpin;
// appending the multi-editor row to a collection of top level grid rows
vGridControl1.Rows.Add(newMultiEditorRow);
Imports DevExpress.XtraVerticalGrid.Rows
Imports DevExpress.XtraEditors.Repository
' creating a new multi-editor row instance
Dim NewMultiEditorRow As New MultiEditorRow()
' assigning the name to the created multi-editor row
NewMultiEditorRow.Name = "MultiEditorRow_MPG"
' creating the first row item, specifying its name and binding it to a data field
Dim RowItem1 As MultiEditorRowProperties = NewMultiEditorRow.PropertiesCollection.Add()
RowItem1.Caption = "MPG City"
RowItem1.FieldName = "MPGCity"
' creating the second row item bound to a data field and specifying its name
Dim RowItem2 As MultiEditorRowProperties = _
NewMultiEditorRow.PropertiesCollection.AddProperties("MPGHighway")
RowItem2.Caption = "MPG Highway"
' assigning the same editor for the created row items
Dim RISpin As RepositoryItemSpinEdit = VGridControl1.RepositoryItems.Add("SpinEdit")
RowItem1.RowEdit = RISpin
RowItem2.RowEdit = RISpin
' appending the multi-editor row to a collection of top level grid rows
VGridControl1.Rows.Add(NewMultiEditorRow)
The following code snippets (auto-collected from DevExpress Examples) contain references to the RowEdit property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-property-grid-create-custom-editor/CS/T415077/Form1.cs#L21
edit.ButtonClick += edit_ButtonClick;
(this.propertyGridControl1.Rows[0] as CategoryRow).ChildRows["rowPath2"].Properties.RowEdit = edit;
}
dashboard-constant-lines/CS/ConstantLineExtension.Win/ConstantLineDialog.cs#L75
propertyGridControl1.SelectedObject = listBoxControl1.SelectedItem;
propertyGridControl1.GetRowByFieldName("MeasureId").Properties.RowEdit = measureEdit;
UpdateRowVisibility();
winforms-property-grid-create-custom-editor/VB/T415077/Form1.vb#L27
AddHandler edit.ButtonClick, AddressOf edit_ButtonClick
TryCast(propertyGridControl1.Rows(0), CategoryRow).ChildRows("rowPath2").Properties.RowEdit = edit
End Sub
See Also
CustomRecordCellEditForEditing