TcxTreeListColumn.OnGetEditProperties Event
Allows you to change the active in-place editor and customize its settings depending on specific conditions.
Declaration
property OnGetEditProperties: TcxTreeListGetEditPropertiesEvent read; write;
Remarks
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.
Event Occurrence
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.
Event Parameters
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.
Code Example: Multiple Editors in a Column
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;
Tip
To see this technique in action, open the ColumnsMultiEditorsDemo project shipped with the ExpressQuantumTreeList Suite.
Important Limitations
Do not perform the following operations within OnGetEditProperties
and OnGetEditingProperties event handlers to avoid possible drawing errors and access violations:
- Do not change Properties, PropertiesClass, and PropertiesClassName property values.
- Do not change individual in-place editor settings accessible through the
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.