Version

PerformAction Method

Simulates user interaction with the control.
Syntax
'Declaration
 
Public Overridable Function PerformAction( _
   ByVal actionCode As UltraTreeAction, _
   ByVal shift As Boolean, _
   ByVal control As Boolean _
) As Boolean
public virtual bool PerformAction( 
   UltraTreeAction actionCode,
   bool shift,
   bool control
)

Parameters

actionCode
An UltraTreeAction enumeration value that determines the user action to be performed.
shift
A boolean which specifies whether the action should be performed as if the shift key is depressed. This mainly affects actions where selection is involved and determines if the existing selection is extended, as it is when the user holds down the shift key and selects a range of rows in a grid.
control
A boolean which specifies whether the action should be performed as if the control key is depressed. This mainly affects actions where selection is involved and determines if the existing selection is maintained, as it is when the user holds down the control key and selects a row in a grid.

Return Value

true if the action completed successfully, false if the action failed.
Remarks

Invoke this method to simulate an action the user can perform.

Many actions are only appropriate in certain situations; if an action is inappropriate, it will not be performed. For example, attempting to delete rows by performing the DeleteRows action (37 - KeyActionDeleteRows) will have no effect if no rows are selected. Similarly, an attempt to toggle a cell's dropdown list by performing a droptown toggle action (14 - KeyActionToggleDropdown) will also be ignored if the column does not have a dropdown list associated with it.

You can use the CurrentState property to determine the state of the control when the action is about to be performed.

Example
The following code illustrates how to test what state a tree control is in and to perform an action based on the current state, in this case toggling the active node's checked state if its style is a checkbox.

Imports Infragistics.Win.UltraWinTree

Private Sub button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button16.Click

    Dim state As UltraTreeState

    ' Get the current state of the tree control
    state = Me.ultraTree1.CurrentState

    ' Check the state bit flags to see if the 'InEdit' bit is set.
    ' Only proceed if the node is not in edit mode.
    If (state And UltraTreeState.InEdit) = 0 Then
        ' Since we aren't in edit mode check the bit that
        ' determines if the active node is a checkbox. 
        ' If it is then call perform action to toggle the
        ' node's check state.
        If (state And UltraTreeState.IsCheckbox) = UltraTreeState.IsCheckbox Then
            Me.ultraTree1.PerformAction(UltraTreeAction.ToggleCheckbox, False, False)
        End If

    End If

End Sub
using Infragistics.Win.UltraWinTree;

private void button16_Click(object sender, System.EventArgs e)
{
	// Get the current state of the tree control
	UltraTreeState state = this.ultraTree1.CurrentState;

	// Check the state bit flags to see if the 'InEdit' bit is set
	// Only proceed if the node is not in edit mode.
	if ( ( state & UltraTreeState.InEdit ) == 0 )
	{
		// Since we aren't in edit mode check the bit that
		// determines if the active node is a checkbox. 
		// If it is then call perform action to toggle the
		// node's check state.
		if ( ( state & UltraTreeState.IsCheckbox ) == UltraTreeState.IsCheckbox )
			this.ultraTree1.PerformAction( UltraTreeAction.ToggleCheckbox, false, false );
	}
		
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also