When the RadScheduler is in MonthView, I want to be able to highlight multiple days that span more than one week. We have implemented a custom context menu when the user right-clicks in the highlighted area, that adds an all-day appointment for each day in the highlighted range once they have selected an option. The problem is we can only highlight a week at a time (on the same row) to get this to work. Once we span multiple rows, the date range does not work.
Is there some property that lets us achieve this?
Is there some property that lets us achieve this?
function
OnClientTimeSlotClick(sender, eventArgs) {
if
(!sender.get_readOnly()) {
var
startTime = sender._rowSelectionState.rowSelectionStartSlot._startTime;
var
endTime = sender._rowSelectionState.rowSelectionEndSlot._startTime;
var
dateStart = window.document.getElementById(
"<%= DateStart.ClientID %>"
);
var
dateEnd = window.document.getElementById(
"<%= DateEnd.ClientID %>"
);
dateStart.value = startTime.toDateString();
dateEnd.value = endTime.toDateString();
}
}
Protected
Sub
RadScheduler_TimeSlotContextMenuItemClicking(
ByVal
sender
As
Object
,
ByVal
e
As
TimeSlotContextMenuItemClickingEventArgs)
Dim
scheduler
As
RadScheduler =
DirectCast
(sender, RadScheduler)
Dim
MyDateStart
As
Date
Dim
MyDateEnd
As
Date
If
Me
.DateStart.Value <>
""
Then
'date range set
MyDateStart =
CDate
(
Me
.DateStart.Value)
MyDateEnd =
CDate
(
Me
.DateEnd.Value).AddDays(1)
If
Not
((e.TimeSlot.Start >= MyDateStart)
And
(e.TimeSlot.
End
<= MyDateEnd))
Then
'single cell is NOT within highlighted range; reset dates
MyDateStart = e.TimeSlot.Start
MyDateEnd = e.TimeSlot.
End
End
If
Else
'date range NOT set
MyDateStart = e.TimeSlot.Start
MyDateEnd = e.TimeSlot.
End
End
If
For
Each
appt
As
Appointment
In
scheduler.Appointments.GetAppointmentsInRange(MyDateStart, MyDateEnd)
'delete appointment(s)
Appointments.Remove(FindById(appt.ID))
Next
AddAppointment(scheduler, MyDateStart, MyDateEnd, e.MenuItem.Text, e.MenuItem.Value)
End
Sub