TreeNodeExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the TreeNode class.
- C#
- VB.NET
public class TreeNodeExtensions
Public Class TreeNodeExtensions
Methods
Checked<TTreeNode>(treeNode, value)
Sets the checked state of the tree node.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to set the checked state on. |
| value | Boolean | A boolean value indicating whether the node is checked. |
Returns: TTreeNode. The modified tree node with the checked state set.
LazyLoading<TTreeNode>(treeNode, value)
Sets the lazy loading property of the tree node.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to set the lazy loading property on. |
| value | Boolean | A boolean value indicating whether lazy loading is enabled. |
Returns: TTreeNode. The modified tree node with the lazy loading property set.
Nodes<TTreeNode>(treeNode, nodes)
Adds an array of child nodes to the specified TreeNode.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to which the child nodes will be added. |
| nodes | TreeNode[] | An array of tree nodes to be added as children. |
Returns: TTreeNode. The tree node with the updated child nodes.
This method allows you to add multiple child nodes to a tree node in a tree view control.
myTreeNode.Nodes(new TreeNode("Child1"), new TreeNode("Child2"));
OnAfterCheck<TTreeNode>(treeNode, action)
Attaches an action to be executed after the tree node is checked.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to attach the action to. |
| action | Action<TTreeNode> | The action to execute after the node is checked. |
Returns: TTreeNode. The tree node with the action attached.
This method allows you to perform custom logic after a tree node's checked state changes.
treeNode.OnAfterCheck(node => { /* custom logic */ });
OnAfterCollapse<TTreeNode>(treeNode, action)
Attaches an action to be executed after the tree node is collapsed.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to attach the action to. |
| action | Action<TTreeNode> | The action to execute after the node is collapsed. |
Returns: TTreeNode. The tree node with the action attached.
This method allows you to perform custom logic after a tree node is collapsed.
treeNode.OnAfterCollapse(node => { /* custom logic */ });
OnAfterExpand<TTreeNode>(treeNode, action)
Attaches an action to be executed after the tree node is expanded.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to attach the action to. |
| action | Action<TTreeNode> | The action to execute after the node is expanded. |
Returns: TTreeNode. The tree node with the action attached.
This method allows you to perform custom logic after a tree node is expanded.
treeNode.OnAfterExpand(node => { /* custom logic */ });
OnAfterSelect<TTreeNode>(treeNode, action)
Attaches an action to be executed after the tree node is selected.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to attach the action to. |
| action | Action<TTreeNode> | The action to execute after the node is selected. |
Returns: TTreeNode. The tree node with the action attached.
This method allows you to perform custom logic after a tree node is selected.
treeNode.OnAfterSelect(node => { /* custom logic */ });
OnBeforeCheck<TTreeNode>(treeNode, action)
Attaches an action to be executed before the tree node is checked.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to attach the action to. |
| action | Action<TTreeNode, TreeViewCancelEventArgs> | The action to execute before the node is checked. |
Returns: TTreeNode. The tree node with the action attached.
This method allows you to perform custom logic before a tree node's checked state changes.
treeNode.OnBeforeCheck((node, args) => { /* custom logic */ });
OnBeforeCollapse<TTreeNode>(treeNode, action)
Attaches an action to be executed before the tree node is collapsed.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to attach the action to. |
| action | Action<TTreeNode, TreeViewCancelEventArgs> | The action to execute before the node is collapsed. |
Returns: TTreeNode. The tree node with the action attached.
This method allows you to perform custom logic before a tree node is collapsed.
treeNode.OnBeforeCollapse((node, args) => { /* custom logic */ });
OnBeforeExpand<TTreeNode>(treeNode, action)
Attaches an action to be executed before the tree node is expanded.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to attach the action to. |
| action | Action<TTreeNode, TreeViewCancelEventArgs> | The action to execute before the node is expanded. |
Returns: TTreeNode. The tree node with the action attached.
This method allows you to perform custom logic before a tree node is expanded.
treeNode.OnBeforeExpand((node, args) => { /* custom logic */ });
OnBeforeSelect<TTreeNode>(treeNode, action)
Attaches an action to be executed before the tree node is selected.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to attach the action to. |
| action | Action<TTreeNode, TreeViewCancelEventArgs> | The action to execute before the node is selected. |
Returns: TTreeNode. The tree node with the action attached.
This method allows you to perform custom logic before a tree node is selected.
treeNode.OnBeforeSelect((node, args) => { /* custom logic */ });
ShowLoader<TTreeNode>(treeNode, value)
Sets the show loader property of the tree node.
| Parameter | Type | Description |
|---|---|---|
| TTreeNode | The type of the tree node, which must inherit from TreeNode. | |
| treeNode | TTreeNode | The tree node to set the show loader property on. |
| value | Boolean | A boolean value indicating whether the loader should be shown. |
Returns: TTreeNode. The modified tree node with the show loader property set.