TdxDbOrgChart.OnLoadNode Event
OnLoadNode occurs when a node has been created and its properties have been read from the dataset.
Declaration
property OnLoadNode: TdxOcEvent read; write;
Remarks
Use the OnLoadNode event to perform specific operations after the node has been created based on the data in a linked dataset.
procedure TForm1.ChartLoadNode(Sender: TObject; Node: TdxOcNode);
begin
if Node.Parent=nil then Node.Shape := shRoundRect; // by Node's properties
if Chart.DataSet.FieldByName('Flag').AsBoolean then
Node.Color := clRed; // by contents of database
end;
On calling OnLoadNode, the current record in the database corresponds to the Node and the event handler must not change its location (Do not use Locate, Fist, Last and MoveBy methods of the dataset or use bookmark to return to the node that corresponds with the Node).
See Also