In-place Editors

  • 3 minutes to read

Vertical grid controls (VGridControl and PropertyGridControl) allow you to assign in-place editors to data cells. This is useful when you need to display different types of data (e.g. images) or to facilitate end-user input. You can use any of the editors supplied by the DevExpress Editors Library or create a custom one if none of the standard editors meet your requirements. The image below shows a sample VGridControl control with different editors assigned to each row.

Concepts - InplaceEditors - Overview

To supply an in-place editor to a grid control, a specific repository item must be created. A repository item is a RepositoryItem class descendant that stores properties and events related to a specific editor. It has all the information required for creating a corresponding fully-functional editor.

Before supplying a repository item to a grid control, it must be added to an internal or external repository (repository item collections).

  • Internal Repository

    The internal repository contains editors that can only be used in the current grid control. It is not possible to use editors from this repository in other controls.

    You can add repository items to the internal repository via a grid control'sEditorContainer.RepositoryItems inherited property. At design time, use a grid control designer's In-place Editor Repository Page page.

  • External Repository

    If you want to use the same editor (repository item) within several grid controls (or other container controls, for example, XtraGrid, XtraTreeList, etc.), you need to use an external repository. It is represented by a PersistentRepository component.

    Create an external repository with specific in-place editors (repository items) and then bind it to the required controls. For instance, to bind it to a grid control, use the grid's EditorContainer.ExternalRepository inherited property.

Refer to the Editors and Simple Controls topic for additional information.

Editors (repository items) can be assigned to row items since they correspond to data fields and thus require the same editor for all data cells. This means that you can either assign an editor to an editor row or to a multi-editor row's item. Please refer to the Assigning Editors to Editor Rows and Assigning Editors to Multi-Editor Rows topics for information on doing this.

The vertical grid control gives you the ability to control how editor buttons are displayed. Use the VGridControlBase.ShowButtonMode property to specify whether editor buttons should always be visible, visible for the focused row, record, cell or only when editing. The VGridControlBase.ShowButtonMode property was set to ShowButtonModeEnum.ShowAlways to make the screenshot above. As you can see, editor buttons are displayed for all data cells that have editors assigned and this makes the control more representative. On the other hand, editor buttons may truncate the information displayed within cells and you may wish to disable them.

See Also