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

PopupWindowShowAction.CustomizeTemplate Event

Occurs when setting a Template for a Pop-up Window Show Action's pop-up Window.

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.v20.2.dll

Declaration

public event EventHandler<CustomizeTemplateEventArgs> CustomizeTemplate
Public Event CustomizeTemplate As EventHandler(Of CustomizeTemplateEventArgs)

Event Data

The CustomizeTemplate event's data class is CustomizeTemplateEventArgs. The following properties provide information specific to this event:

Property Description
Context Returns the context in which the Template to be customized was created.
Template Provides access to the Template to be customized.

Remarks

A Pop-up Window Show Action displays a pop-up Window with a specified View. In a Windows Forns application, the PopupForm or LookupForm Template is used, depending on whether a Detail or List View is included. In an ASP.NET Web application, the Dialog.aspx page is used as a Template. To customize the pop-up Window's Template, handle the CustomizeTemplate event that occurs after assigning the Template to the Window. Use the handler's CustomizeTemplateEventArgs.Template parameter to access the Template.

The following code snipped demonstrates a sample CustomizeTemplate event handler implementation. The code displays Actions from the PopupActions category at the top of the pop-up window, in Windows Forms applications.

using DevExpress.ExpressApp.Templates;
using DevExpress.ExpressApp.Win.Templates.ActionContainers;
using DevExpress.XtraLayout;
//...
private void MyPopupAction_CustomizeTemplate(object sender, CustomizeTemplateEventArgs e) {
    foreach (IActionContainer container in e.Template.GetContainers()) {
        if (container.ContainerId == "PopupActions" && container is ButtonsContainer) {
            LayoutControl layoutControl = (LayoutControl)((ButtonsContainer)container).Parent;
            layoutControl.Dock = System.Windows.Forms.DockStyle.Top;
            break;
        }
    }
}
See Also