vcl-cxtl-dot-tcxtreelistcolumn-3afbdbf9.md
Allows you to change the active in-place editor and customize its settings depending on specific conditions.
property OnGetEditProperties: TcxTreeListGetEditPropertiesEvent read; write;
You can handle OnGetEditProperties and OnGetEditingProperties events to use multiple in-place editors in one tree list column. The OnGetEditProperties event allows you to use different in-place editors for different cells in a column while the OnGetEditingProperties event allows you to change the active in-place editor and its settings when a user invokes it.
The OnGetEditProperties event occurs every time the parent Tree List control determines the required in-place editor and its settings for the column, for example, when displayed data changes.
You can use Sender and ANode parameters to identify the data cell whose in-place editor the parent Tree List control is about to determine. The AEditProperties parameter allows you to use a preconfigured edit repository item to change the active in-place editor or its settings for the currently processed cell.
Refer to the TcxTreeListGetEditPropertiesEvent 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 from an edit repository component to display different in-place editors for data cells that have different roles in a column. The OnGetEditProperties event handler example determines required editor types and settings by node indexes.
procedure TColumnsMultiEditorsDemoMainForm.clnSampleGetEditProperties(
Sender: TcxTreeListColumn; ANode: TcxTreeListNode;
var EditProperties: TcxCustomEditProperties);
begin
if ANode.Level <= 0 then Exit;
EditProperties := EditRepository.Items[ANode.Index].Properties;
end;
void __fastcall TfrmScrollbarAnnotations::tlDBStatusGetEditingProperties(
TcxTreelistColumn *Sender, TcxTreeListNode *ANode, TcxCustomEditProperties *&EditProperties)
{
if(ANode->Level <= 0) { return; }
EditProperties = EditRepository->Items[ANode->Index]->Properties;
}
Tip
To see this technique in action, open the ColumnsMultiEditorsDemo project shipped with the ExpressQuantumTreeList Suite.
Do not perform the following operations within OnGetEditProperties and OnGetEditingProperties event handlers to avoid possible drawing errors and access violations:
AEditProperties 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 AEditProperties parameter.
See Also
TcxCustomGridTableItem.OnGetProperties Event
TcxPivotGridField.OnGetProperties Event