PopupBaseEdit.CancelPopup() Method
Closes the popup window discarding the changes made.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v22.2.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
Remarks
The CancelPopup method closes the popup window and restores the editor’s previous value (i.e. before invoking the window). Note: this method is only useful for editors whose popup windows are not closed immediately after changing edit values. For instance, choosing a date within the date editor’s dropdown calendar immediately closes the dropdown. For an editor that can update its value while the dropdown is open, end-users can press the ESC key to close the dropdown discarding changes made. MemoExEdit and ImageEdit editors also provide the Cancel button within their dropdowns for this.
The following events are raised when attempting to close an editor’s dropdown window:
- RepositoryItemPopupBase.QueryCloseUp. The event allows you to prevent the dropdown window from being closed.
- RepositoryItemPopupBase.CloseUp. The event enables you to specify whether modifications made within the dropdown should be accepted or discarded.
To close the dropdown window accepting changes, use the PopupBaseEdit.ClosePopup method.