Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxEditRepositoryCheckBoxItem Class

A repository item that stores check box editor settings.

#Declaration

Delphi
TcxEditRepositoryCheckBoxItem = class(
    TcxEditRepositoryItem
)

#Remarks

A check box editor allows users to switch between two or three states of an option.

The TcxEditRepositoryCheckBoxItem class overrides the Properties property that allows you to access and customize check box settings.

#Edit Repository Items and Standalone Editors

Edit 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 edit repository item to RepositoryItem properties of all target editors.

#Edit Repository Items and Container Controls

A container control item (such as a toolbar edit item or a column (or any other data item) in a Data Grid, Vertical Grid, or Tree List control) can embed an in-place editor shipped with the ExpressEditors Library. An in-place editor exists (and, therefore, has its own WinAPI handle) only when the target container control item is being edited. Otherwise, the container control item displays a static editor image for resource usage optimization.

VCL Tree List: An In-Place Date Editor

#Create a Check Box Repository Item at Design Time

To create a check box repository item at design time, double-click a TcxEditRepository component to invoke its collection editor.

VCL Editors Library: An Edit Repository Collection Editor

The collection editor dialog allows you to manage repository items. Click the Add… button to invoke a repository item creation dialog.

VCL Editors Library: An Edit Repository Item Creation Dialog

Select the CheckBox item and click the Ok button to create a check box repository item.

#Create a Check Box Repository Item in Code

The following code example creates a check box repository item, customizes editor settings, and assigns the created repository item to two existing unbound check box editors:

uses cxEdit, cxEditRepositoryItems;
// ...
var
  ACheckBoxRepositoryItem: TcxEditRepositoryCheckBoxItem;
  ARepositoryItem: TcxEditRepositoryItem;
begin
  ARepositoryItem := cxEditRepository1.CreateItem(TcxEditRepositoryCheckBoxItem);
  ACheckBoxRepositoryItem := ARepositoryItem as TcxEditRepositoryCheckBoxItem;
  ACheckBoxRepositoryItem.Properties.AllowGrayed := True; // Enables an intermediate check box state
  ACheckBoxRepositoryItem.Properties.FullFocusRect := True; // Outlines the check box when it has focus
  // Assigns the created repository item to two existing unbound check box editors
  cxCheckBox1.RepositoryItem := ACheckBoxRepositoryItem;
  cxCheckBox2.RepositoryItem := ACheckBoxRepositoryItem;
end;

#Check Box Repository Item Deletion

To delete all check box repository items in an edit repository component, call its RemoveItems procedure and pass a reference to the TcxEditRepositoryCheckBoxItem class as a parameter.

If you need to delete an individual check box repository item, release it directly in code (call the Free procedure in Delphi or use the delete keyword in C++Builder).

#Inheritance

See Also