ActionBase.CustomizeControl Event

Occurs after the control is initialized. Allows customizing the default control settings.

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public event EventHandler<CustomizeControlEventArgs> CustomizeControl
Public Event CustomizeControl As EventHandler(Of CustomizeControlEventArgs)

Event Data

The CustomizeControl event handler receives an argument of the CustomizeControlEventArgs type.

Remarks

Do not handle this event for a built-in Action in a View or Window Controller's OnActivated method because this method is called after the Action controls creation. Use the OnFrameAssigned method instead.

The CustomizeControlEventArgs.Control event parameter returns the Action Item object which provides access to the control settings. See all of the possible scenarios in the Action section of the Feature Center demo that is installed in the %PUBLIC%\Documents\DevExpress Demos 18.2\Components\eXpressApp Framework\FeatureCenter folder by default, or refer to the Feature Center demo online. The lists below show which type of Action Item is returned for different Action types.

ASP.NET Specific Scenarios

  • SimpleAction

    Returned value type:

    myAction.CustomizeControl += (s, e) => {
        SimpleActionMenuActionItem actionItem = e.Control as SimpleActionMenuActionItem;
        // or 
        ASPxGridViewCustomButtonInitializer initializer = e.Control as ASPxGridViewCustomButtonInitializer;
        //...
    }
    
  • SingleChoiceAction menu Actions.

    The returned value type depends on the SingleChoiceAction.ItemType property value and ChoiceActionItems sub items:

    • SingleChoiceActionAsModeMenuActionItem;
    • SingleChoiceActionItemAsHierarchicalModeActionMenuItem;
    • SingleChoiceActionItemAsOperationActionMenuItem.
    myAction.CustomizeControl += (s, e) => {
        SingleChoiceActionAsModeMenuActionItem actionItem = e.Control as SingleChoiceActionAsModeMenuActionItem;
        // or
        SingleChoiceActionItemAsHierarchicalModeActionMenuItem actionItem = e.Control as SingleChoiceActionItemAsHierarchicalModeActionMenuItem;
        // or
        SingleChoiceActionItemAsOperationActionMenuItem actionItem = e.Control as SingleChoiceActionItemAsOperationActionMenuItem;
        //...
    }
    
  • ShowNavigationItem Action returned by the ShowNavigationItemController.ShowNavigationItemAction property.

    Returned value type:

    Frame.GetController<ShowNavigationItemController>().ShowNavigationItemAction.CustomizeControl += (s, e) => {
        ASPxNavBar navBar = e.Control as ASPxNavBar;
        // or
        ASPxTreeView treeView = e.Control as ASPxTreeView;
        //...
    }
    
  • ParametrizedAction.

    Returned value type is ParametrizedActionMenuActionItem.

    myAction.CustomizeControl += (s, e) => {
        ParametrizedActionMenuActionItem actionItem = e.Control as ParametrizedActionMenuActionItem;
        //...
    }
    
  • PopupWindowShowAction.

    Returned value type:

    myAction.CustomizeControl += (s, e) => {
        PopupWindowActionMenuActionItem actionItem = e.Control as PopupWindowActionMenuActionItem;
        // or
        ASPxGridViewCustomButtonInitializer actionItem = e.Control as ASPxGridViewCustomButtonInitializer;
        //...
    }
    

WinForms Specific Scenarios

  • SimpleAction.

    Returned value type:

    myAction.CustomizeControl += (s, e) => {
        SimpleButton control = e.Control as SimpleButton;
        // or
        BarButtonItem control = e.Control as BarButtonItem;
        //...
    }
    
  • SingleChoiceAction.

    Returned value type:

    myAction.CustomizeControl += (s, e) => {
        ImageComboBoxEdit control = e.Control as ImageComboBoxEdit;
        // or
        BarEditItem control = e.Control as BarEditItem;
        //...
    }
    
  • ShowNavigationItem Action returned by the ShowNavigationItemController.ShowNavigationItemAction property.

    Returned value type:

    Frame.GetController<ShowNavigationItemController>().ShowNavigationItemAction.CustomizeControl += (s, e) => {
        NavBarControl navBar = e.Control as NavBarControl;
        // or
        TreeList treeList = e.Control as TreeList;
        //...
    }
    
  • ParametrizedAction.

    Returned value type:

    myAction.CustomizeControl += (s, e) => {
        DateEdit control = e.Control as DateEdit;
        // or
        BarEditItem control = e.Control as BarEditItem;
        //...
    }
    
  • PopupWindowShowAction.

    Returned value type:

    myAction.CustomizeControl += (s, e) => {
        SimpleButton control = e.Control as SimpleButton;
        // or
        BarButtonItem control = e.Control as BarButtonItem;
        //...
    }
    
See Also