TcxCustomEdit.RepositoryItem Property
Declaration
property RepositoryItem: TcxEditRepositoryItem read; write;
Property Value
An edit repository item (a TcxEditRepositoryItem class descendant) is a non-visual component designed to define and store editor settings. Repository items are useful when you need to share the same settings between multiple editors of the same type. To accomplish this goal, you can assign the same repository item to RepositoryItem properties of all target editors.
Available Edit Repository Item Types
Every repository item type defines the corresponding in-place editor type and stores editor settings. You can access and modify these settings using the TcxEditRepositoryItem.Properties property.
The following table lists all available edit repository item types (terminal TcxEditRepositoryItem class descendants) and corresponding in-place editor classes:
C — Calculator | Check Box | Combo Box | …
D — Date & Time Editors
H — Hyperlink Editor
I — Image Combo Box & Image Editors
L — Label
L — Lookup Editors
Warning
Do not use repository items to share settings between multiple lookup editors because these settings include data binding options.
A repository item shared between multiple lookup editors binds them to the same dataset. This scenario may lead to data update and synchronization issues that are difficult to detect and identify.
M — Mask/Memo/MRU Editors
N — Numeric Wheel Picker Editor
P — Pop-Up Editor & Progress Bar
R — Radio Group | Range Track Bar | RTF Editor | …
S — Sparkline & Spin Editors
T — Text Editor | Time Editor | Toggle Switch | …
Note
The RepositoryItem property has priority over the Properties property. All settings accessible through the Properties property have no effect when a repository item is assigned to the RepositoryItem property.
Code Example: Shared Barcode Editor Settings
The following code example creates a barcode repository item, selects QR Code as the barcode type, customizes its settings, and assigns the created repository item to two existing standalone unbound barcode editors:
uses cxEdit, cxEditRepositoryItems;
// ...
var
ABarCodeRepositoryItem: TcxEditRepositoryBarCodeItem;
ARepositoryItem: TcxEditRepositoryItem;
AQRCodeSymbology: TdxBarCodeQRCodeSymbology;
begin
ARepositoryItem := cxEditRepository1.CreateItem(TcxEditRepositoryBarCodeItem);
ABarCodeRepositoryItem := TcxEditRepositoryBarCodeItem(ARepositoryItem);
ABarCodeRepositoryItem.Properties.BarCodeSymbologyClass := TdxBarCodeQRCodeSymbology;
AQRCodeSymbology := TdxBarCodeQRCodeSymbology(ABarCodeRepositoryItem.Properties.Symbology);
AQRCodeSymbology.ErrorCorrectionLevel := eclH; // Increases encoded information redundancy
AQRCodeSymbology.CompactionMode := qrmAlphaNumeric; // Changes the information encoding mode
// Assigns the created repository item to two existing unbound barcode editors
dxBarCode1.RepositoryItem := ABarCodeRepositoryItem;
dxBarCode2.RepositoryItem := ABarCodeRepositoryItem;
end;
#include "cxEdit.hpp"
#include "cxEditRepositoryItems.hpp"
// ...
TcxEditRepositoryBarCodeItem *ABarCodeRepositoryItem;
TcxEditRepositoryItem *ARepositoryItem;
TdxBarCodeQRCodeSymbology *AQRCodeSymbology;
// ...
ARepositoryItem = cxEditRepository1->CreateItem(__classid(TcxEditRepositoryBarCodeItem));
ABarCodeRepositoryItem = dynamic_cast<TcxEditRepositoryBarCodeItem*>(ARepositoryItem);
ABarCodeRepositoryItem->Properties->BarCodeSymbologyClass = __classid(TdxBarCodeQRCodeSymbology);
AQRCodeSymbology = dynamic_cast<TdxBarCodeQRCodeSymbology*>(ABarCodeRepositoryItem.Properties.Symbology);
AQRCodeSymbology->ErrorCorrectionLevel = eclH; // Increases encoded information redundancy
AQRCodeSymbology->CompactionMode = qrmAlphaNumeric; // Changes the information encoding mode
// Assigns the created repository item to two existing unbound barcode editors
dxBarCode1->RepositoryItem = ABarCodeRepositoryItem;
dxBarCode2->RepositoryItem = ABarCodeRepositoryItem;
RepositoryItem Properties in Other Products
- TcxCustomBarEditItem.RepositoryItem
- Specifies an edit repository item component for the toolbar editor item.
- TcxCustomEditorRowProperties.RepositoryItem
- Specifies an edit repository item component for the vertical grid row.
- TcxCustomGridTableItem.RepositoryItem
- Specifies an edit repository item component for the grid table item.
- TcxCustomInplaceEditContainer.RepositoryItem
- Specifies an edit repository item for the data item.
- TcxLookupGridColumn.RepositoryItem
- Specifies the repository item used as an editor for a specific column’s content.
- TcxPivotGridField.RepositoryItem
- Specifies an edit repository item component for the pivot grid field.
See Also