EditorsRepositoryBase Class
Implements the basic functionality of the PersistentRepository component.
Namespace: DevExpress.XtraEditors.Repository
Assembly: DevExpress.XtraEditors.v25.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
Remarks
The EditorsRepositoryBase class serves as the base for the PersistentRepository component which contains a collection of repository items that can be shared by different controls and components. The ancestor implements repository item collection management functionality providing the EditorsRepositoryBase.Items property for this purpose. The introduced EditorsRepositoryBase.CollectionChanged and EditorsRepositoryBase.PropertiesChanged events allow bound controls to respond to changes affecting the collection or individual items.
Example
The following example uses a PersistentRepository to reuse a single repository item in a Data Grid and a Tree List.
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Repository;
public partial class Form1 : XtraForm {
public Form1() {
InitializeComponent();
// Create a persistent repository
PersistentRepository rep = new PersistentRepository();
//Add a repository item to the persistent repository
RepositoryItemSpinEdit spin = new RepositoryItemSpinEdit();
rep.Items.Add(spin);
//Link the persistent repository to controls
gridControl1.ExternalRepository = rep;
treeList1.ExternalRepository = rep;
// Assign the repository item to columns
gridView1.Columns["Id"].ColumnEdit = spin;
treeList1.Columns["Id"].ColumnEdit = spin;
}
}