TreeViewExtensions
Wisej.Web.Markup.TreeViewExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.0.0.0)
Adds fluent markup extension methods to the TreeView class.
public class TreeViewExtensions
Methods
Nodes<TTreeView>(treeView, nodes)

Adds an array of root nodes to the specified TreeView.
Returns: TTreeView. The tree view with the updated root nodes.
This method allows you to add multiple root nodes to a tree view control.
myTreeView.Nodes(new TreeNode("Root1"), new TreeNode("Root2"));
OnAfterCheck<TTreeView>(treeView, action)

Extension method to attach an action to the AfterCheck event of a TreeView.
TTreeView
The type of the TreeView, which must inherit from TreeView.
action
The action to execute when the AfterCheck event is triggered.
Returns: TTreeView. The original TreeView instance with the event handler attached.
This method allows you to execute a custom action whenever a node in the TreeView is checked or unchecked.
treeView.OnAfterCheck((tv, e) => {
// Custom logic here
});
OnAfterCollapse<TTreeView>(treeView, action)

Extension method to attach an action to the AfterCollapse event of a TreeView.
TTreeView
The type of the TreeView, which must inherit from TreeView.
action
The action to execute when the AfterCollapse event is triggered.
Returns: TTreeView. The original TreeView instance with the event handler attached.
This method allows you to execute a custom action whenever a node in the TreeView is collapsed.
treeView.OnAfterCollapse((tv, e) => {
// Custom logic here
});
OnAfterExpand<TTreeView>(treeView, action)

Attaches an action to be executed after a node is expanded in the TreeView.
TTreeView
The type of the TreeView.
Returns: TTreeView. The configured TreeView instance.
This method allows you to specify an action that will be executed after a node is expanded in the TreeView.
var treeView = new TreeView();
treeView.OnAfterExpand((tv, e) => { /* action */ });
OnAfterSelect<TTreeView>(treeView, action)

Attaches an action to be executed after a node is selected in the TreeView.
TTreeView
The type of the TreeView.
Returns: TTreeView. The configured TreeView instance.
This method allows you to specify an action that will be executed after a node is selected in the TreeView.
var treeView = new TreeView();
treeView.OnAfterSelect((tv, e) => { /* action */ });
OnBeforeCheck<TTreeView>(treeView, action)

Extension method to attach an action to the BeforeCheck event of a TreeView.
TTreeView
The type of the TreeView, which must inherit from TreeView.
action
The action to execute when the BeforeCheck event is triggered.
Returns: TTreeView. The original TreeView instance with the event handler attached.
This method allows you to execute a custom action before a node in the TreeView is checked or unchecked.
treeView.OnBeforeCheck((tv, e) => {
// Custom logic here
});
OnBeforeCollapse<TTreeView>(treeView, action)

Extension method to attach an action to the BeforeCollapse event of a TreeView.
TTreeView
The type of the TreeView, which must inherit from TreeView.
action
The action to execute when the BeforeCollapse event is triggered.
Returns: TTreeView. The original TreeView instance with the event handler attached.
This method allows you to execute a custom action before a node in the TreeView is collapsed.
treeView.OnBeforeCollapse((tv, e) => {
// Custom logic here
});
OnBeforeExpand<TTreeView>(treeView, action)

Attaches an action to be executed before a node is expanded in the TreeView.
TTreeView
The type of the TreeView.
Returns: TTreeView. The configured TreeView instance.
This method allows you to specify an action that will be executed before a node is expanded in the TreeView.
var treeView = new TreeView();
treeView.OnBeforeExpand((tv, e) => { /* action */ });
OnBeforeSelect<TTreeView>(treeView, action)

Attaches an action to be executed before a node is selected in the TreeView.
TTreeView
The type of the TreeView.
Returns: TTreeView. The configured TreeView instance.
This method allows you to specify an action that will be executed before a node is selected in the TreeView.
var treeView = new TreeView();
treeView.OnBeforeSelect((tv, e) => { /* action */ });
ShowLoader<TTreeView>(treeView, value)

Sets the loader visibility of the TreeView.
Returns: TTreeView. The configured TreeView instance.
This method allows you to show or hide a loader on a TreeView.
var treeView = new TreeView();
treeView.ShowLoader(true);
VirtualScroll<TTreeView>(treeView, value)

Sets the virtual scrolling capability of the TreeView.
Returns: TTreeView. The configured TreeView instance.
This method allows you to enable or disable virtual scrolling on a TreeView.
var treeView = new TreeView();
treeView.VirtualScroll(true);
Last updated
Was this helpful?