ISchedulerInplaceEditorEx.CommitChanges Event
Raise this event to save the modified value to the underlying data source.
Namespace: DevExpress.XtraScheduler
Assembly:
DevExpress.XtraScheduler.v24.1.Core.Desktop.dll
NuGet Package:
DevExpress.Scheduler.CoreDesktop
Declaration
event EventHandler CommitChanges
Event CommitChanges As EventHandler
Event Data
The CommitChanges 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