vcl-cxvgrid-dot-tcxcustomeditorrowproperties-60acbd7e.md
Allows you to change the active in-place editor and customize its settings depending on custom conditions.
property OnGetEditProperties: TcxVerticalGridGetEditPropertiesEvent read; write;
You can handle OnGetEditProperties and OnGetEditingProperties events to use multiple in-place editors in one vertical grid row. The OnGetEditProperties event allows you to use different in-place editors for different cells in a vertical grid row while the OnGetEditingProperties event allows you to change the active in-place editor and its settings when a user activates it.
The OnGetEditProperties event occurs every time the parent Vertical Grid control determines the required in-place editor and its settings for the column, for example, when displayed data changes.
You can use Sender and ARecordIndex parameters to identify the currently processed data cell. The AProperties parameter allows you to use a preconfigured edit repository item to change the active in-place editor or its settings for the target cell.
Refer to the TcxVerticalGridGetEditPropertiesEvent procedural type description for detailed information on parameters accessible within OnGetEditProperties and OnGetEditingProperties event handlers.
The following code example handles the OnGetEditProperties event and uses multiple edit repository items in an edit repository component to display different in-place editors for data cells that have different roles in a vertical grid row. The OnGetEditProperties event handler example determines required editor types and settings by record indexes.
procedure TMyForm.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;
void __fastcall TMyForm::cxDBVerticalGrid1GradePropertiesGetEditProperties(
TcxCustomEditorRowProperties *Sender, int ARecordIndex,
TcxCustomEditProperties *&AProperties)
{
int AItemOffset = 6;
switch (static_cast<int>(fmod(ARecordIndex, AItemOffset))) {
case 0: AProperties = SpinItemYears->Properties; break;
case 1, 2: AProperties = ImageComboLanguages->Properties; break;
case 3: AProperties = ImageComboCommunication->Properties; break;
case 4: AProperties = DateItemStartWorkFrom->Properties; break;
}
}
Do not perform the following operations within OnGetEditProperties and OnGetEditingProperties event handlers to avoid possible drawing errors and access violations:
AProperties parameter.Tip
To change the active in-place editor type or its settings within an OnGetEditProperties event handler in a safe manner, assign the Properties property value of an edit repository item to the AProperties parameter.
See Also
TcxCustomGridTableItem.OnGetProperties Event
TcxPivotGridField.OnGetProperties Event
TcxTreeListColumn.OnGetEditProperties Event
TcxCustomEditorRowProperties Class