VB.NET
Private
Sub
DbiDayView1_AfterAppointmentChange(ByVal sender
As Object,
ByVal e
As Dbi.WinControl.DayView.AfterAppointmentChangeEventArgs)
Handles
DbiDayView1.AfterAppointmentChange
'NOTE: The
AfterAppointmentChange event fires when an appointment in
the dbiDayView collection is moved or resized. This occurs
when a user moves an appointment by clicking and dragging
with the mouse, or when an appointment's start/end is
changed by clicking and dragging with the mouse.
If Not
editMode Then
'NOTE: Changing the appointment
in the detail dialog will cause the AfterAppointmentChange
event to fire.
''The editMode public variable is used to
programmatically distinguish between changes made in the
detail dialog and those made directly through the dbiDayView
interface.
Dim
recordRow
As
DayViewDemo.AppointmentsRow
'Cast the DataRow stored in the
appointment object tag back into a data row.
recordRow = e.Appointment.Tag
'Set the Start, End, and AllDay
flag fields in the database record.
recordRow.Item("StartDateTime") =
e.Appointment.Start
recordRow.Item("EndDateTime") = e.Appointment.End
recordRow.Item("AllDayEvent") = e.Appointment.AllDayEvent
End If
End Sub
C#
private void
DbiDayView1_AfterAppointmentChange(object sender,
Dbi.WinControl.DayView.AfterAppointmentChangeEventArgs
e)
{
//NOTE:
The AfterAppointmentChange event fires when an appointment
in the dbiDayView collection is moved or resized. This
occurs when a user moves an appointment by clicking and
dragging with the mouse, or when an appointment's start/end
is changed by clicking and dragging with the mouse.
if
(!editMode)
{
//NOTE: Changing the appointment
in the detail dialog will cause the AfterAppointmentChange
event to fire.The editMode public variable is used to
programmatically distinguish between changes made in the
detail dialog and those made directly through the dbiDayView
interface.
CalendarDemo.AppointmentsRow
recordRow;
//Cast the DataRow stored in the
appointment object tag back into a data row.
recordRow = (CalendarDemo.AppointmentsRow)e.Appointment.Tag;
//Set the Start, End, and AllDay
flag fields in the database record.
recordRow["StartDateTime"] = (DateTime)e.Appointment.Start;
recordRow["EndDateTime"] = (DateTime)e.Appointment.End;
recordRow["AllDayEvent"] = (bool)e.Appointment.AllDayEvent;
}
}
|