PopupBaseEdit.CancelPopup() Method
Closes the popup window discarding the changes made.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v24.1.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.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CancelPopup() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.