Skip to main content

RepositoryItemPopupBase.QueryPopUp Event

Enables you to specify whether an attempt to open the editor’s popup window will succeed.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Events")]
public virtual event CancelEventHandler QueryPopUp

Event Data

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

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled.

Remarks

The QueryPopUp event is raised each time the editor’s popup window is about to be opened. Handle the event when you want to stop the window from being opened by setting the event’s Cancel parameter to true.

An editor’s popup window cannot be opened if the editor is disabled or read-only (the RepositoryItem.Enabled property value is false or the RepositoryItem.ReadOnly property value is true).

The current QueryPopUp event is equivalent to the editor’s PopupBaseEdit.QueryPopUp event.

Example

The following code lists a PopupBaseEdit.QueryPopUp event handler which enables opening the dropdown window only if the user typed the text in the edit box which matches an item in the RepositoryItemComboBox.Items collection.

If the user typed a value which does not exist in the collection, the popup is not opened.

private void comboBoxEdit1_QueryPopUp(object sender, 
  System.ComponentModel.CancelEventArgs e) {
    ComboBoxEdit combo = sender as ComboBoxEdit;
    e.Cancel = combo.Properties.Items.IndexOf(combo.Text) == -1;
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the QueryPopUp event.

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.

See Also