This is a migrated thread and some comments may be shown as answers.

Showing Occurrence data in AppointmentItemTemplate

1 Answer 47 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Softwel
Top achievements
Rank 1
Softwel asked on 06 Feb 2013, 10:01 AM
Hello,

We are using Telerik Silverlight Controls 2012 Q2. We're attempting to achieve the following:
We have a custom appointment that has a Task. This Task can be completed or not. When the user makes an appointment with recurrence, he will be able to completed the Task separately for each recurrence.
So if he has an appointment that has a daily recurrence starting today:
06/02/2013 - Task Completed
07/02/2013 - Task Not Completed
....

When the user opens the appointment he can see if he completed the Task. The user now wants to see this in the Day/Week/Month view without having to open the task. I know I should be adjusting the AppointmentItemTemplate in order to achieve this, however the AppointmentItemTemplate only allows binding to the appointment itself, and not to its occurrences.
Is there any way to show Occurrence data in the AppointmentItemTemplate (it should I imagine, since Start and End do show the Occurrence data).

Something like this, but where TaskCompleted is actually part of the Occurrence instead of the appointment.

<DataTemplate x:Key="AppointmentItemTemplate">
    <StackPanel Orientation="Horizontal">
        <TextBlock Text="Task Completed" Visibility="{Appointment.TaskCompleted, Converter={StaticResource BooleanToVisibilityConverter}" />
        <TextBlock Text="{Binding Start, StringFormat='HH:mm'}" TextWrapping="Wrap" />
        <TextBlock Text="-" TextWrapping="Wrap" />
        <TextBlock Text="{Binding End, StringFormat='HH:mm'}" TextWrapping="Wrap" Margin="0,0,5,0" />
        <TextBlock Text="{Binding Subject}" TextWrapping="Wrap" TextTrimming="WordEllipsis" />
    </StackPanel>
</DataTemplate>

The TaskCompleted is added to the Storage of the appointment.

Any ideas how to get this functionality?

1 Answer, 1 is accepted

Sort by
0
Softwel
Top achievements
Rank 1
answered on 08 Feb 2013, 10:38 AM
I've been investigating this a bit further. I think I have found the solution:

From one of your help articles I've created a RecurrenceExceptionHelper. In here I'll change the Appointment class to my own custom appointment class and I'll add more variables in the ExceptionString. I'll then change the MakeExceptionString method to incorporate these new properties.

However, right now the ExceptionString in stored in the database as a field in the Appointment table (varchar(Max)).
Since the stored string would become pretty big, it also seems logical to make changes to the database. Instead of storing the ExceptionString in one varchar(MAX) field, we would create a separate table to store all the ExceptionStrings, liked to the parent Appointment.

We can then even only load the Exceptions which are visible, decreasing string manipulations needed (if the occurrence would run for 2 years, and if the user is trigger happy for making Exceptions, the program would end up with massive string manipulations).

I'll use the binding written above to show it.

In my early tests this works as expected. Would this be a suggested way of achieving this functionality?
Tags
ScheduleView
Asked by
Softwel
Top achievements
Rank 1
Answers by
Softwel
Top achievements
Rank 1
Share this question
or