Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Enable Opening ComboBox's Dropdown Window Based on Custom Logic

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;
}