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.v24.2.dll
NuGet Package: DevExpress.ExpressApp
Declaration
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 Forms 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;
}
}
}