Skip to main content

RowProperties.RowEdit Property

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.v24.1.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

Declaration

[DefaultValue(null)]
public virtual RepositoryItem RowEdit { get; set; }

Property Value

Type Default Description
RepositoryItem null

A RepositoryItem descendant.

Remarks

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.

Example

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);

The following code snippet (auto-collected from DevExpress Examples) contains a reference 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.

See Also