Back to Devexpress

TdxTreeViewNodeAllowEvent Type

vcl-dxtreeview-85b2d765.md

latest1.9 KB
Original Source

TdxTreeViewNodeAllowEvent Type

The action permission procedural type for tree nodes.

Declaration

delphi
TdxTreeViewNodeAllowEvent = procedure(Sender: TdxCustomTreeView; ANode: TdxTreeViewNode; var Allow: Boolean) of object;

Parameters

NameTypeDescription
SenderTdxCustomTreeView

The Tree View control that raised an action permission event.

| | ANode | TdxTreeViewNode |

The target tree node.

| | Allow | Boolean |

Assign False to this parameter to prohibit users from performing the action. To allow the action, assign False to the parameter.

|

Remarks

The OnCollapsing event handler below prohibits the control from collapsing nodes at the top nesting level:

delphi
procedure TForm1.dxTreeViewControl1Collapsing(Sender: TdxCustomTreeView;
  ANode: TdxTreeViewNode; var Allow: Boolean);
begin
  if ANode.Parent = Sender.Root then
    Allow := False;
end;
cpp
void __fastcall TForm1::dxTreeViewControl1Collapsing(TdxCustomTreeView *Sender,
  TdxTreeViewNode *ANode, bool &Allow)
{
  if (ANode->Parent == Sender->Root)
    Allow = false;
}

The following Tree View events reference the TdxTreeViewNodeAllowEvent type:

See Also

dxTreeView Unit