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

TcxCustomEditorRowProperties.OnGetEditProperties Event

Enables you to assign display value formatting editors to individual data cells.

Declaration

property OnGetEditProperties: TcxVerticalGridGetEditPropertiesEvent read; write;

Remarks

This event fires when the row’s data cell is displayed.

Sender provides access to the row’s settings.

ARecordIndex returns the index of the data record to be edited.

Sender and ARecordIndex parameter values identify the currently processed data cell. Pass the editor class (a TcxCustomEditProperties descendant) as the AProperties parameter to specify the cell’s display value formatting editor. To provide different editor properties within the event, use the edit repository as a store for editor properties. Create repository items corresponding to specific editors and adjust their properties as required. Then, use the Properties object of these repository items to pass it via the AProperties event parameter.

If an editor is assigned via the OnGetEditProperties event handler, the settings defined by the RepositoryItem, EditProperties and EditPropertiesClass are ignored.

To provide different in-place editors for data cells, handle the OnGetEditingProperties event.

The following example shows how to handle the OnGetEditProperties event to assign editor types from repository items (TcxEditRepository items) and vary editor types depending on the record index. The example assumes that a form contains a TcxEditRepository component with four repository items (namely, SpinItemYears, ImageComboLanguages, ImageComboCommunication, and DateItemStartWorkFrom) in it.

// ...
procedure TForm1.cxDBVerticalGrid1GradePropertiesGetEditProperties(
  Sender: TcxCustomEditorRowProperties; ARecordIndex: Integer;
  var AProperties: TcxCustomEditProperties);
var AItemOffset: Integer;
begin
  AItemOffset := 6;
  case ARecordIndex mod AItemOffset of
    0: AProperties := SpinItemYears.Properties;
    1, 2: AProperties := ImageComboLanguages.Properties;
    3: AProperties := ImageComboCommunication.Properties;
    4: AProperties := DateItemStartWorkFrom.Properties;
  end;

This is the code execution result:

See Also