[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Collapse]Editors and Simple Controls
   [Collapse]Simple Editors
    [Expand]Included Components
    [Collapse]Editors Structure
      Editor Hierarchy
      Editor Class Structure
      Editor Containers
      Repositories and Repository Items
      Custom Editors
    [Expand]Editors Features
    [Expand]Member Tables
   [Expand]Lookup Editors
   [Expand]Token Edit Control
   [Expand]Breadcrumb Edit Control
   [Expand]Range Control
   [Expand]Image Slider
    Camera Control
    Templated ListBox Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Repositories and Repository Items

The Editors of the DevExpress Editors Library can be used to perform in-place editing in the container controls provided by DevExpress. This topic describes the mechanism used to assign in-place editors to container controls.

Expanded Online Video

Expanded Editor Repositories and Repository Items

Each editor which can be used for in-place editing has a Properties property which stores the settings and event handlers that correspond to this editor. This property represents an instance of the class derived from the RepositoryItem class. For instance, a date editor (DateEdit) provides the DateEdit.Properties property of the RepositoryItemDateEdit type.

Objects derived from the RepositoryItem class are called Repository Items. As you can see a repository item is a part of an editor (the repository item can be accessed via the editor's Properties property). But repository items can also exist as standalone objects.

You should create specific repository items as standalone objects to embed editors of particular types into container controls (XtraGrid, XtraVerticalGrid, Tree List and XtraBars). For instance, you need to create a RepositoryItemButtonEdit object to embed a ButtonEdit in a container control. See the Editors document for a list of the editors that can be used in-place and their corresponding repository items.

Enough information is contained in a repository item to create a fully functional editor. For instance, when an end-user clicks a cell within the Grid Control to activate an in-place editor, the grid does the following:

  • First, it looks for the repository item which is assigned to this cell.
  • It then creates an editor which corresponds to this repository item based upon the information provided by this item.
  • Then all the settings and event handlers of the source repository item are copied to the editor's Properties property.
  • Finally the editor is displayed within the clicked cell. When an end-user leaves the cell the editor is automatically destroyed but the source repository item isn't affected.

To use a repository item in a container control it must be added to this control's internal editor repository or to an external editor repository:

Containers can use repository items stored within both repositories. Thus, the entire collection of repository items that are available is comprised of the items stored within the internal repository and the items added to the bound external repository, if any.

Repository items created within containers at design time are automatically added to internal repositories. Items created via code should be added to repositories manually.

Expanded Example

The following code shows how to assign a DateEdit in-place editor to a TreeList column in a TreeList control. This example creates the required repository item (RepositoryItemDateEdit), adds it to the control's internal repository and then binds the repository item to a column.

Expanded Design-Time Tools

All the container components and controls provided by DevExpress have their own facilities (which are all very similar) for managing their internal repository at design time. The following screenshots demonstrate how to add editors to a grid control's internal repository. This is done using the grid control's designer dialog.

The list displays all the repository items which reside within the grid's internal repository. To add an editor to the repository, press the down arrow near the Add button. This opens the dropdown list which allows you to specify the type of the repository item:

External repositories (PersistentRepository components) provide a similar designer for their collection of repository items. To invoke the designer, press the ellipsis button which corresponds to the EditorsRepositoryBase.Items property or utilize the component's smart tag.

Once repository items have been added to the desired collections and customized as required, you should bind them to particular visual elements (columns, data cells, etc). To learn how to do this, please refer to the documentation provided for the container control or component you are using.

Expanded See Also

Is this topic helpful?​​​​​​​