[]
        
(Showing Draft Content)

GrapeCity.ActiveReports.Design.Designer.ExecuteAction

ExecuteAction Method

ExecuteAction(DesignerAction)

Executes the specified DesignerAction command within the designer environment.

Declaration
public void ExecuteAction(DesignerAction action)
Parameters
Type Name Description
DesignerAction action

The DesignerAction to be executed. This action corresponds to various design-time operations such as adding new controls, deleting controls, or changing properties.

Remarks

This method facilitates the execution of design-time actions, typically triggered by user interaction with custom toolbars or menus in the designer interface. It allows for the extension of the designer's functionality by enabling the execution of predefined actions programmatically.

Examples
// The following example demonstrates how to remove selected items from the designer surface by executing the EditDelete action:
private void RemoveSelectedItems()
{
	designer.ExecuteAction(DesignerAction.EditDelete);
}
// You can also clear the designer surface by selecting all items and deleting them
private void Clear()
{
	designer.ExecuteAction(DesignerAction.SelectAll);
	designer.ExecuteAction(DesignerAction.EditDelete);
}

ExecuteAction(DesignerAction, object)

Executes the specified DesignerAction command with an optional parameter. This method can be utilized when implementing custom toolbars or menus within the designer environment. It enables the execution of report actions in response to user interactions with toolbar or menu items.

Declaration
public void ExecuteAction(DesignerAction action, object parameter)
Parameters
Type Name Description
DesignerAction action

The DesignerAction to execute. This parameter specifies the action to be performed by the designer.

object parameter

A parameter that can be passed to the action. This can be used to provide additional context or data required for the action's execution.

Remarks

The method supports a wide range of design-time actions, including but not limited to adding or removing controls, modifying properties, and triggering custom logic defined in extensions or plugins.