Hello guyz
UltraDayView provides us some useful events like BeoforeAppointmentMoved, AfterAppointmentResized. But these events are not
available for MonthView and WeeView. If I want to write code against drag n drop events in these views, what should I do ?
I should also note that i do a
private void _monthView_MouseDown(object sender, MouseEventArgs e) { if (this._monthView.GetAppointmentFromPoint(e.X, e.Y) != null) { _selectedAppointment = this._monthView.GetAppointmentFromPoint(e.X, e.Y); _selectedAppointment.Selected = true; } else _selectedAppointment = null; }
on the mousedown event to select the appointment so i know what changed.
Hello,
Well i got the solution of the problem.....as we dont have the events of beforeAppointmentMoved & afterAppointmentMoved.....but we can achieve this functionality by using two of events mouseDown & mouseUp....sample code is as follow:
private void ultraWeekView1_MouseDown(object sender, MouseEventArgs e) { if (this.ultraCalendarInfo1 != null && this.ultraCalendarInfo1.SelectedAppointments != null && this.ultraCalendarInfo1.SelectedAppointments.Count > 0) { this.day = this.ultraWeekView1.GetDayFromPoint(e.Location); this.startTime = this.ultraCalendarInfo1.SelectedAppointments[0].StartDateTime; this.endTime = this.ultraCalendarInfo1.SelectedAppointments[0].EndDateTime; } } private void ultraWeekView1_MouseUp(object sender, MouseEventArgs e) { if (this.day != null) { if (this.day.Date != this.ultraWeekView1.GetDayFromPoint(e.Location).Date && this.ultraCalendarInfo1.SelectedAppointments.Count > 0) { if (this.ultraCalendarInfo1.SelectedAppointments[0].StartDateTime < DateTime.Now) { this.ultraCalendarInfo1.SelectedAppointments[0].StartDateTime = this.startTime; this.ultraCalendarInfo1.SelectedAppointments[0].EndDateTime = this.endTime; MessageBox.Show("Cannot create appt in past"); } } } }
Thank You
Hello there,
We are doing the same thing. Double click opens a dialog to edit if you click on an appointment, if there is a no appointment it opens the same dialog but we are not editting anything, just adding.
{
EditActivity();
else
NewActivity();
}
So on the first click of the double click the appointment is selected then on the second click it hit the event i pasted in.
This should work for you.
Sorry for taking so long to reply, it's been a busy week.
Hello jisleyjr,
Well i m also facing the same prob but ur solution is not appropriate in my scenario, that is, when user double click on any apt than i m showing appointment dialog, and also i want the drag n drop events. Now in ur solution how whould i come to know that user has either drag the apt or just double click on it to open the dialog....??
Please help me..