Skip to main content

Assigning Editors to Data Field's Cells

  • 2 minutes to read

This topic describes how to assign editors to cells corresponding to data fields. When assigning editors in this manner, data editing is enabled for all cells of the target data field. If you need to provide editors only for specific cells, you can use the solution described in the Assigning Editors to Individual Cells topic.

For general information on providing in-place editors for cells, see Cell Editors Overview.

Since all of our editor containers (Data Grid, Tree List, Pivot Grid, etc.) use similar approaches and APIs that allow you to replace default editors, you can also refer to the Data Grid documentation, the Cell Values, Editors, and Validation article.

Assigning Editors to Data Field’s Cells

To specify an in-place editor for data field cells, create a specific repository item, add it to the pivot grid’s repository (the [DevExpress.XtraPivotGrid.PivotGridControl.RepositoryItems]((xref:DevExpress.XtraEditors.Container.EditorContainer.RepositoryItems) collection) and then assign it to the data field using the PivotGridField.FieldEdit property.

At design time, you can choose the required repository item using the PivotGridField.FieldEdit property in the Properties window. This property provides a design-time dropdown editor listing all available editor types. If you create a new repository item, it is automatically added to the control’s repository.

The image below shows how to access a data field’s PivotGridField.FieldEdit property by clicking on a field header and accessing the property in the Properties window.

Editors_FieldEdit_DesignTime

Example

The following example shows how to assign an in-place editor to cells of a specific data field, via the PivotGridField.FieldEdit property. The assigned in-place editor (ProgressBar) controls the representation of cells in display mode:

FieldEdit

using DevExpress.XtraEditors.Repository;

RepositoryItemProgressBar riProgressBar = new RepositoryItemProgressBar();
pivotGridControl1.RepositoryItems.Add(riProgressBar);
fieldPercents.FieldEdit = riProgressBar;