Skip to main content
All docs
V24.2

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

LookUpEdit.SelectionChanging Event

Occurs before a user selects an item in the editor’s popup. This event works in Multiple Item Selection mode only.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Events")]
public event EventHandler<PopupSelectionChangingEventArgs> SelectionChanging

#Event Data

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

Property Description
Cancel Gets or sets whether to cancel the change selection operation.
IsSelected Gets whether the item is selected.

#Remarks

The SelectionChanging event allows you to retain the item’s selected state. The following code sample does not allow users to toggle the first item’s selection:

private void lookUpEdit1_SelectionChanging(object sender, DevExpress.XtraEditors.Controls.PopupSelectionChangingEventArgs e) {
    e.Cancel = e.RecordIndex == 0;
}
See Also