New to Telerik UI for WinForms? Start a free 30-day trial

Expands or collapses a node, optionally using a supplied Boolean state.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class NodeExpandCollapseCommand : CommandBase, IImageListProvider

Inheritance: objectCommandBaseNodeExpandCollapseCommand

Implements: IImageListProvider

Constructors

C#
public NodeExpandCollapseCommand()

Methods

Determines whether the command can change a tree node's expanded state.

C#
public override bool CanExecute(object parameter)
Parameters:parameterobject

The candidate node.

Returns:

bool

true for a RadTreeNode; otherwise, the base command result.

Overrides: CommandBase.CanExecute(object)

Toggles the node when no state is supplied, or applies the requested expanded state.

C#
public override object Execute(params object[] settings)
Parameters:settingsobject[]

The first setting is the node; an optional second setting is a Boolean state or an IList containing that state.

Returns:

object

The node's resulting expanded state, or null when the command cannot execute.

Overrides: CommandBase.Execute(params object[])