Hi there,
I'm trying to assign resources to appointments in the code behind. When I assign them, the appointment displays the correct resource when I edit the appointment, however the appointment itself is displayed in the blank resource column.
Here is the XAML:
And here is the code behind:
ExamRoomAppointment inherits from Appointment.
I must be doing something wrong here but I can't seem to figure it out!
Thanks,
Anthony
I'm trying to assign resources to appointments in the code behind. When I assign them, the appointment displays the correct resource when I edit the appointment, however the appointment itself is displayed in the blank resource column.
Here is the XAML:
<
telerik:RadScheduleView
x:Name
=
"ScheduleView"
SnapAppointments
=
"True"
>
<
telerik:RadScheduleView.ResourceTypesSource
>
<
telerik:ResourceTypeCollection
>
<
telerik:ResourceType
DisplayName
=
"Room"
Name
=
"Room"
>
<
telerik:Resource
DisplayName
=
"Room 1"
ResourceName
=
"Room 1"
ResourceType
=
"Room"
/>
<
telerik:Resource
DisplayName
=
"Room 2"
ResourceName
=
"Room 2"
ResourceType
=
"Room"
/>
</
telerik:ResourceType
>
</
telerik:ResourceTypeCollection
>
</
telerik:RadScheduleView.ResourceTypesSource
>
<
telerik:RadScheduleView.GroupDescriptionsSource
>
<
telerik:GroupDescriptionCollection
>
<
telerik:ResourceGroupDescription
ResourceType
=
"Room"
ShowNullGroup
=
"True"
/>
</
telerik:GroupDescriptionCollection
>
</
telerik:RadScheduleView.GroupDescriptionsSource
>
<
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:DayViewDefinition
DayStartTime
=
"7:00"
DayEndTime
=
"19:00"
MajorTickLength
=
"1h"
MinorTickLength
=
"10min"
/>
<
telerik:WeekViewDefinition
DayStartTime
=
"7:00"
DayEndTime
=
"19:00"
/>
</
telerik:RadScheduleView.ViewDefinitions
>
</
telerik:RadScheduleView
>
And here is the code behind:
private
ObservableCollection<Appointment> appointments;
void
ExamRoomScheduler_Loaded(
object
sender, RoutedEventArgs e)
{
appointments =
new
ObservableCollection<Appointment>();
ScheduleView.AppointmentsSource = appointments;
ExamRoomAppointment temp;
temp =
new
ExamRoomAppointment(
"Test"
, DateTime.Now, DateTime.Now.AddMinutes(20),
"Room 1"
);
appointments.Add(temp);
temp.Resources.Add(
new
Resource() { ResourceType =
"Room"
, ResourceName =
"Room 1"
, DisplayName =
"Room 1"
});
}
ExamRoomAppointment inherits from Appointment.
I must be doing something wrong here but I can't seem to figure it out!
Thanks,
Anthony