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

Appointment tile changes not getting reflected on UI

3 Answers 42 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Sanket
Top achievements
Rank 1
Sanket asked on 18 Jul 2013, 08:55 AM

I have used custom appointment in my project and added a "VisitTime" time property in the appointment template. When I load my calendar for the first time the time reflects correctly in the Appointment tile but when I change the time in code for that appointment, the changes are not getting reflected properly in the appointment tile in UI. The "VisitTime" property is defined as below and is defined in the VisitAppointment class derived from appointment class of telerik.

 public DateTimeOffset VisitTime
        {
            get { return _visitTime; }
            set
            {
                _visitTime = value;
                OnPropertyChanged(() => VisitTime);
            }
        }

 I tried using Edit() and Commit() method which are provided by default from telerik in order to update the changes in the UI. I passed the modified appointments collection(i.e custom appointments derived from telerik Appointment class) in the Edit() method and then later on called Commit() but still the changes are not getting reflected until and unless I reload the calendar (i.e fetch data from database again and then create the appointments collection from scratch).

 Please help me out with the necessary things that you think I might have missed out.

 Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Ventzi
Telerik team
answered on 22 Jul 2013, 06:58 AM
Hello Sanket,

You should to use the Storage method of the AppointmentBase class in order to access the instance which owns the fields. You could find more information about the custom appointment here.

Hope this helps.

Regards,
Ventzi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sanket
Top achievements
Rank 1
answered on 23 Jul 2013, 07:35 AM

Hello Ventzi,
            Thanx for the reply.
            I tried setiing value using storage method.Propery set worked fine while loading the calendar.But when I did changes to the time of the  appointment from the code,in the set I got invalid cast exception,"unable to cast Appointment to task" on the line
 var storage = this.Storage<Task>();

            Can you please help in that ?


0
Ventzi
Telerik team
answered on 25 Jul 2013, 03:11 PM
Hi Sanket,

The exception says that the Task type is not of type Appointment. You need to inherit the Appointment or AppointmentBase class or implement the IAppointment interface. Here you could find an article with detailed explanation on how to achieve this goal.

Regards,
Ventzi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ScheduleView
Asked by
Sanket
Top achievements
Rank 1
Answers by
Ventzi
Telerik team
Sanket
Top achievements
Rank 1
Share this question
or