Skip to main content
Version: 4.2

OrgChart

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.2.0.0)

Displays an interactive hierarchy of people, departments, or assets.

public class OrgChart : Control

Multiple roots form a forest. Unknown parent identities are displayed as roots until the parent is added. Root depth is zero. Branch visibility is separate from node ownership. Dragging proposes a move only on drop; the server raises NodeMoving and then NodeMoved if accepted.

Example:

var chart = new OrgChart { Dock = DockStyle.Fill, AllowDragReparent = true, CollapseBelow = 2 };
chart.Nodes.Add(new OrgNode { Id = "operations", Text = "Nadia", SubText = "VP Operations" });
chart.Nodes.Add(new OrgNode { Id = "support", ParentId = "operations", Text = "Leila" });
chart.NodeMoving += (sender, e) => e.Cancel = e.Node.Id == "operations";
Controls.Add(chart);

Constructors​

Instance member OrgChart()​

Creates an empty, top-down hierarchy with all branches initially expanded.

Properties​

Instance member AllowDragReparent​

Boolean: Gets or sets whether the user may drag a node onto a new parent; defaults to false. (Default: False)

Instance member ChartLayout​

OrgChartLayout: Gets or sets the hierarchy direction, without hiding the inherited Layout event. (Default: TopDown)

Instance member CollapseBelow​

Int32: Gets or sets the depth whose branches initially collapse; -1 expands all levels and roots have depth zero. (Default: -1)

Zero shows only roots. One shows roots and their children. Explicit SetExpanded calls override this default. Changing this property clears all overrides and applies the new default.

Example:

chart.CollapseBelow = 1;
chart.SetExpanded(chart.Nodes[1], true); // Open a branch at the collapsed level.

Instance member CollapseBranchText​

String: Gets or sets the localized override for the "Collapse branch" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.

Instance member ExpandBranchText​

String: Gets or sets the localized override for the "Expand branch" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.

Instance member Focusable​

Boolean: Gets or sets whether the chart can receive the focus. The default is false. (Default: False)

Instance member Nodes​

OrgNodeCollection: Gets the owned nodes in sibling and root display order.

Instance member NodeTemplate​

Type: Gets or sets the concrete UserControl type used as node content, or null for the standard presentation. (Default: null)

The type needs a public parameterless constructor. OrgChart owns and disposes instances when their nodes become hidden or removed, or the template type changes. Tag receives the OrgNode; implement IOrgNodeTemplate to receive node updates. Template Size determines node geometry.

Example:

chart.NodeTemplate = typeof(EmployeeNodeControl); // UserControl implementing IOrgNodeTemplate.

Instance member ReportsText​

String: Gets or sets the localized override for the "{0} reports" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation. {0} is the direct report count. Used for the CLDR other category of the current UI culture. Literal braces can be written as {{ and }}.

Instance member ReportText​

String: Gets or sets the localized override for the "{0} report" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation. {0} is the direct report count. Used for the CLDR one category of the current UI culture. Literal braces can be written as {{ and }}.

Instance member TabStop​

Boolean: Gets or sets whether the chart takes part in tab navigation. The default is false. (Default: False)

Methods​

Protected member Dispose(disposing)​

Releases subscriptions and all chart-owned templates; borrowed images and Tag remain caller-owned.

ParameterTypeDescription
disposingBooleanWhether managed resources should be released.

Instance member IsExpanded(node)​

Gets the effective expansion state, including CollapseBelow and explicit branch overrides.

ParameterTypeDescription
nodeOrgNodeAn owned node.

Returns: Boolean. Whether children are shown when this node is visible.

Instance member MoveNode(node, parent)​

Proposes a reparent operation through the same cancelable server events as a drop.

ParameterTypeDescription
nodeOrgNodeAn owned node to move.
parentOrgNodeAn owned new parent, or null for a root.

Returns: Boolean. True only when the move commits.

Parent may be null to promote a node to a root. Programmatic moves do not require AllowDragReparent or an enabled control. Self-parenting and cycles return false. Reentrant moves and hierarchy mutations during NodeMoving invalidate the original proposal.

Example:

chart.MoveNode(chart.Nodes[1], chart.Nodes[0]);
chart.MoveNode(chart.Nodes[1], null); // Promote to a root.

Protected member OnExpandChanged(e)​

Raises ExpandChanged for subscribers and derived controls.

ParameterTypeDescription
eOrgNodeExpandEventArgsEvent data.

Protected member OnNodeClick(e)​

Raises NodeClick for subscribers and derived controls.

ParameterTypeDescription
eOrgNodeEventArgsEvent data.

Protected member OnNodeDoubleClick(e)​

Raises NodeDoubleClick for subscribers and derived controls.

ParameterTypeDescription
eOrgNodeEventArgsEvent data.

Protected member OnNodeMoved(e)​

Raises NodeMoved for subscribers and derived controls.

ParameterTypeDescription
eOrgNodeMoveEventArgsEvent data.

Protected member OnNodeMoving(e)​

Raises NodeMoving for subscribers and derived controls.

ParameterTypeDescription
eOrgNodeMoveEventArgsEvent data.

Protected member OnWebEvent(e)​

Dispatches validated client requests to dedicated processing methods.

ParameterTypeDescription
eWisejEventArgsClient event.

Protected member OnWebRender(config)​

Renders first-level behavior properties and an atomic visible hierarchy snapshot.

ParameterTypeDescription
configObjectClient configuration.

Instance member SetExpanded(node, expanded)​

Expands or collapses a branch and raises ExpandChanged when the effective state changes.

ParameterTypeDescription
nodeOrgNodeAn owned node.
expandedBooleanWhether to show its children.

Events​

Instance member ExpandChanged​

EventHandler<OrgNodeExpandEventArgs> Occurs after a branch is expanded or collapsed through SetExpanded or the client.

Instance member NodeClick​

EventHandler<OrgNodeEventArgs> Occurs when a node is activated with the pointer or keyboard.

Instance member NodeDoubleClick​

EventHandler<OrgNodeEventArgs> Occurs when a node is double-clicked.

Instance member NodeMoved​

EventHandler<OrgNodeMoveEventArgs> Occurs after a reparent operation has been committed.

Instance member NodeMoving​

EventHandler<OrgNodeMoveEventArgs> Occurs before a valid proposed reparent operation; set Cancel to reject it.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.