ISchedulerInplaceEditorEx.RollbackChanges Event
Raise this event to cancel changes and replace the modified value with the former value (a value before modification).
Namespace: DevExpress.XtraScheduler
Assembly:
DevExpress.XtraScheduler.v24.2.Core.Desktop.dll
Declaration
event EventHandler RollbackChanges
Event RollbackChanges As EventHandler
Event Data
The RollbackChanges event's data class is EventArgs.
This example demonstrates how to change default keys used to close an appointment in-place editor. Create a custom in-place editor and override its TextBox_KeyDown method. This sample code specifies that the Ctrl+S shortcut saves changes and closes the editor, while the Ctrl+Z shortcut discards changes and closes the editor.
public class MyInplaceEditor : DevExpress.XtraScheduler.Native.SchedulerInplaceEditorEx
{
public MyInplaceEditor(DevExpress.XtraScheduler.SchedulerInplaceEditorEventArgs inplaceEditorArgs, Appointment apt)
: base(inplaceEditorArgs, apt)
{
}
protected override void TextBox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if (e.Control && e.KeyCode == System.Windows.Forms.Keys.S)
{
OnCommitChanges();
e.Handled = true;
}
else if (e.Control && e.KeyCode == System.Windows.Forms.Keys.Z)
{
OnRollbackChanges();
e.Handled = true;
}
else
//base.TextBox_KeyDown(sender, e);
e.Handled = true;
}
}
Public Class MyInplaceEditor
Inherits DevExpress.XtraScheduler.Native.SchedulerInplaceEditorEx
Public Sub New(ByVal inplaceEditorArgs As DevExpress.XtraScheduler.SchedulerInplaceEditorEventArgs, ByVal apt As Appointment)
MyBase.New(inplaceEditorArgs, apt)
End Sub
Protected Overrides Sub TextBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
If e.Control AndAlso e.KeyCode = System.Windows.Forms.Keys.S Then
OnCommitChanges()
e.Handled = True
ElseIf e.Control AndAlso e.KeyCode = System.Windows.Forms.Keys.Z Then
OnRollbackChanges()
e.Handled = True
Else
'base.TextBox_KeyDown(sender, e);
e.Handled = True
End If
End Sub
End Class
See Also