ShowViewStrategyBase.ShowViewInPopupWindow(View, Action, Action, String, String) Method

Shows the specified View in a popup dialog with OK and Cancel buttons in WinForms and ASP.NET applications.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public void ShowViewInPopupWindow(
    View view,
    Action okDelegate = null,
    Action cancelDelegate = null,
    string okButtonCaption = null,
    string cancelButtonCaption = null
)
Public Sub ShowViewInPopupWindow(
    view As View,
    okDelegate As Action = Nothing,
    cancelDelegate As Action = Nothing,
    okButtonCaption As String = Nothing,
    cancelButtonCaption As String = Nothing
)

Parameters

Type Name Description
View view

A View to be shown in a popup.

Action okDelegate

A Action delegate to be executed when the OK button is clicked. This parameter is optional.

Action cancelDelegate

A Action delegate to be executed when the Cancel button is clicked. This parameter is optional.

String okButtonCaption

A string specifying the custom caption of the OK button. This parameter is optional.

String cancelButtonCaption

A string specifying the custom caption of the Cancel button. This parameter is optional.

Remarks

The ShowViewInPopupWindow method displays the dialog containing the specified View and two buttons - OK and Cancel. Both these buttons close the dialog. Additionally, if the okDelegate and cancelDelegate handlers are specified, they are executed when the corresponding button is clicked. The following code displays the Contact List View in a popup:

Application.ShowViewStrategy.ShowViewInPopupWindow(
    Application.CreateListView(typeof(Contact), true), OkDelegate, CancelDelegate);
// ...
public void OkDelegate() {
    // place the code for the 'OK' button here
}
public void CancelDelegate() {
    // place the code for the 'Cancel' button here
}

Here, Application is the XafApplication object. For instance, it can be accessed using the Controller.Application, ActionBase.Application or Frame.Application property.

Note

ASP.NET applications have certain specifics:

  • The ShowViewInPopupWindow method can be used on XafCallbackManager callbacks initiated by the RaiseXafCallback script. It cannot be used on callbacks of controls (e.g., grid sorting).
  • It is not possible to pause the current request to wait for user input.
  • Main window is not refreshed when the Cancel button is clicked.
See Also