ChangingEventHandler Delegate
Represents a method that will handle the RepositoryItem.EditValueChanging event.
Namespace: DevExpress.XtraEditors.Controls
Assembly: DevExpress.XtraEditors.v24.2.dll
NuGet Package: DevExpress.Win.Navigation
#Declaration
public delegate void ChangingEventHandler(
object sender,
ChangingEventArgs e
);
#Parameters
Name | Type | Description |
---|---|---|
sender | Object | The event sender (typically the Base |
e | Changing |
A Changing |
#Remarks
When creating a ChangingEventHandler
delegate, you identify the method that will handle the corresponding event. To associate an event with your event handler, add a delegate instance to this event. The event handler is called whenever the event occurs unless you remove the delegate.
The code sample below handles the TextEdit’s EditValueChanged
event to accept only numeric values:
textEdit1.EditValueChanging += TextEdit1_EditValueChanging;
void TextEdit1_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e) {
int i = 0;
if (!int.TryParse(e.NewValue.ToString(), out i))
e.Cancel = true;
}