or
Is there any way to create an AppointmentCollection and manually fill with Appointment objects, along the lines of:
Create new AppointmentCollection
Grab Appointments from database
Loop through, add new Appointment objects to AppointmentCollection
Call AppointmentCollection.GetAppointmentsInRange
Currently I am doing this, but there must be an easier way to do without having to use a RadScheduler.
// Check for a conflict |
var appointments = dc.Appointments.Select(b => b.IsCancelled == false); |
RadScheduler scheduler = new RadScheduler(); |
scheduler.DataKeyField = "AppointmentID"; |
scheduler.DataSubjectField = "Subject"; |
scheduler.DataStartField = "Start"; |
scheduler.DataEndField = "End"; |
scheduler.DataRecurrenceField = "RecurrenceRule"; |
scheduler.DataRecurrenceParentKeyField = "RecurrenceParentID"; |
scheduler.DataSource = appointments; |
scheduler.DataBind(); |
return scheduler.Appointments.GetAppointmentsInRange(startTime, endTime).Count == 0; |
Cheers,
Mike
<
telerik:RadNumericTextBox
ID
=
"txtSomeData"
runat
=
"server"
Font-Names
=
"tahoma, sans-serif"
Font-Size
=
"11px"
MaxLength
=
"5"
MaxValue
=
"24"
MinValue
=
"0"
Width
=
"90px"
ShowSpinButtons
=
"true"
Type
=
"Number"
Value
=
"0.0"
>
<
NumberFormat
DecimalDigits
=
"2"
PositivePattern
=
"n hours"
DecimalSeparator
=
"."
AllowRounding
=
"true"
/>
<
InvalidStyle
ForeColor
=
"Crimson"
/>
<
EnabledStyle
HorizontalAlign
=
"Center"
CssClass
=
"fieldlabelSmall"
/>
</
telerik:RadNumericTextBox
>
<
telerik:RadScheduler
ID
=
"radScheduler"
runat
=
"server"
Height
=
"90%"
Skin
=
"Forest"
EnableEmbeddedSkins
=
"False"
OnAppointmentCreated
=
"radScheduler_AppointmentCreated"
OnAppointmentDataBound
=
"radScheduler_AppointmentDataBound"
OnNavigationComplete
=
"radScheduler_NavigationComplete"
EnableResourceEditing
=
"False"
OnClientAppointmentDoubleClick
=
"appointmentDoubleClick"
AdvancedForm-Enabled
=
"false"
AllowInsert
=
"False"
RowHeight
=
"20px"
Localization-HeaderMultiDay
=
"Work Week"
NumberOfHoveredRows
=
"1"
EnableAdvancedForm
=
"False"
SelectedView
=
"MonthView"
EnableExactTimeRendering
=
"True"
Width
=
"100%"
>
<
AdvancedForm
Modal
=
"false"
Enabled
=
"false"
/>
<
DayView
DayStartTime
=
"08:00:00"
EnableExactTimeRendering
=
"true"
/>
<
MonthView
VisibleAppointmentsPerDay
=
"4"
/>
<
WeekView
DayStartTime
=
"08:00:00"
EnableExactTimeRendering
=
"true"
/>
<
MultiDayView
DayStartTime
=
"08:00:00"
UserSelectable
=
"true"
NumberOfDays
=
"5"
/>
<
Localization
HeaderMultiDay
=
"Work Week"
></
Localization
>
<
TimelineView
SlotDuration
=
"1:00:00"
ColumnHeaderDateFormat
=
"HH:mm"
EnableExactTimeRendering
=
"True"
NumberOfSlots
=
"7"
/>
<
Reminders
Enabled
=
"true"
/>
<
AppointmentTemplate
>
<
div
style
=
"float: left;"
>
<
a
id
=
"achSubject"
href
=
"javascript:alert('Navigate to Open Appointment')"
>
<%# Eval("Subject") %>
</
a
>
</
div
>
<
div
>
<
div
class
=
"rsAptReminder"
style
=
"display: <%# Eval("
alarm_on") %>"></
div
>
<%--<
img
alt
=
""
src
=
"Images/reminder.gif"
height
=
"16px"
width
=
"16px"
style
=
"display: <%# Eval("
alarm_on") %>" />--%>
</
div
>
<
div
class
=
"rsAptAct"
style
=
"padding-left: 2px; float: left; padding-top:2px; vertical-align:bottom;"
">
<
img
alt
=
""
width
=
"12px"
height
=
"10px"
src
=
"<%# AppointmentTypeImage(Eval("
act_type")) %>" />
</
div
>
<
div
style
=
"float: left; padding-left: 0px;"
>
<
div
style
=
"float: left; display: <%# AppointmentRecuuringImage(Eval("
recurring_id"),Eval("outlook_recurrence_id_range")) %>;" class="rsAptRecurrence">
</
div
>
<%--<
img
alt
=
""
height
=
"16px"
width
=
"16px"
src
=
"Images/recur.gif"
style
=
"display: <%# AppointmentRecuuringImage(Eval("
recurring_id"),Eval("outlook_recurrence_id_range")) %>" />--%>
</
div
>
</
AppointmentTemplate
>
</
telerik:RadScheduler
>