windowsforms-devexpress-dot-xtraeditors-dot-lookupedit-6821d28c.md
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.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXCategory("Events")]
public event EventHandler<PopupSelectionChangingEventArgs> SelectionChanging
<DXCategory("Events")>
Public Event SelectionChanging As EventHandler(Of PopupSelectionChangingEventArgs)
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. |
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;
}
Private Sub lookUpEdit1_SelectionChanging(ByVal sender As Object, ByVal e As DevExpress.XtraEditors.Controls.PopupSelectionChangingEventArgs)
e.Cancel = e.RecordIndex = 0
End Sub
See Also