Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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
    Templated ListBox Items
   [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]Examples
   [Expand]Lookup Editors
   [Expand]Token Edit Control
   [Expand]Breadcrumb Edit Control
   [Expand]Range Control
   [Expand]Image Slider
    Camera Control
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap 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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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 editor which will be used for in-place editing to a column in the XtraTreeList. First, a repository item (RepositoryItemDateEdit) corresponding to the required editor is created and added to the control's internal repository. Then this repository item is bound to a specific column:

The result is shown in the image below:

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

How would you rate this topic?​​​​​​​