.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

ActionControlsSiteController.CustomizeActionControl Event

Occurs when an Action control is created.

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v20.1.dll

Declaration

public event EventHandler<ActionControlEventArgs> CustomizeActionControl
Public Event CustomizeActionControl As EventHandler(Of ActionControlEventArgs)

Event Data

The CustomizeActionControl event's data class is DevExpress.ExpressApp.SystemModule.ActionControlEventArgs.

Remarks

IMPORTANT

This event is designed to support the internal XAF infrastructure and should not be handled in your code. Use the ActionBase.CustomizeControl event instead.

Below is an example of how to handle this event to customize the created control properties.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.XtraBars;
using DevExpress.XtraEditors.Repository;
// ...
public class CustomizeActionControlController : WindowController {
    protected override void OnActivated() {
        base.OnActivated();
        Frame.GetController<ActionControlsSiteController>().CustomizeActionControl +=
            ActionControlsSiteController_CustomizeActionControl;
    }
    protected override void OnDeactivated() {
        Frame.GetController<ActionControlsSiteController>().CustomizeActionControl -=
           ActionControlsSiteController_CustomizeActionControl;
        base.OnDeactivated();
    }
    private void ActionControlsSiteController_CustomizeActionControl(object sender, ActionControlEventArgs e) {
        if (e.ActionControl.ActionId == "MyDateFilter") {
            BarEditItem barItem = (BarEditItem)e.ActionControl.NativeControl;
            barItem.Width = 170;
            RepositoryItemDateEdit repositoryItem = (RepositoryItemDateEdit)barItem.Edit;
            repositoryItem.Mask.UseMaskAsDisplayFormat = true;
            repositoryItem.Mask.EditMask = "yyyy-MMM-dd";
        }
    }
}
TIP

If you need to create an alternate control rather than customize the default control's properties, handle the ActionControlsSiteController.CustomAddActionControlToContainer and ActionControlsSiteController.CustomBindActionControlToAction events instead.

See Also