Skip to main content
A newer version of this page is available. .

PersistentRepository.Items Property

Provides access to the collection of repository items stored in the repository.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

[DXCategory("Data")]
[InheritableCollection]
public override RepositoryItemCollection Items { get; }

Property Value

Type Description
RepositoryItemCollection

A RepositoryItemCollection object that contains a collection of repository items.

Remarks

The Items property returns the object that provides methods to add, remove and access items within the current persistent repository.

Each item in the RepositoryItemCollection is represented by a particular RepositoryItem class descendant.

Example

The following example shows how to share a single repository item between two Grid Controls. For this purpose, an external PersistentRepository component must be used.

First, add a specific repository item to the persistent repository and customize it depending upon your needs. Then link the persistent repository to the ExternalRepository properties of the required grid controls. After that, assign the repository item to the required grid columns via the ColumnEdit property.

In this example we create a repository item corresponding to an ImageComboBoxEdit editor.

using DevExpress.XtraEditors.Repository;

//Add a repository item corresponding to a combo box editor to the persistent repository
RepositoryItemComboBox riCombo = new RepositoryItemComboBox();
riCombo.Items.AddRange(new string[] {"Cash", "Visa", "Master", "Am.Express" });
persistentRepository1.Items.Add(riCombo);

//Link the persistent repository to two grid controls
gridControl1.ExternalRepository = persistentRepository1;
gridControl2.ExternalRepository = persistentRepository1;

//Now you can define the repository item as an inplace editor of columns for the two grids
(gridControl1.MainView as GridView).Columns["PaymentType"].ColumnEdit = riCombo;
(gridControl2.MainView as GridView).Columns["PaymentType"].ColumnEdit = riCombo;

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