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

Updating an appointment

0 Answers 44 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 21 Oct 2011, 12:20 PM
I've added a resource to the advanced form template as below

 <ResourceTypes>
                    <telerik:ResourceType KeyField="ID" Name="Type" />
</ResourceTypes>

I'm populating this drop down in the code behing on load

    rad_diary.Resources.Add(New Resource("Type", 1, "Appointment"))
    rad_diary.Resources.Add(New Resource("Type", 4, "Out of office"))

When adding a new appointment I grab the value of this using the following

 Protected Sub rad_diary_AppointmentInsert(ByVal sender As Object, ByVal e As SchedulerCancelEventArgs)

appointmentitem = e.Appointment.Resources.GetResourceByType("Type").Key

end sub

This works fine when inserting a new entry.

My problems arises  when I try to update an existing appointment - the same line of code to get the value of my resource i.e

Protected Sub rad_diary_AppointmentUpdate(ByVal sender As Object, ByVal e As AppointmentUpdateEventArgs)

appointmentitem = e.Appointment.Resources.GetResourceByType("Type").Key

end sub

When I click to update and this sub runs to get the value I get an error saying

Error : : Object reference not set to instance of an object.

Any help would be gladly recieved - I've searched long and hard for a solution but cannot find one.

Thanks in advance

Tim

No answers yet. Maybe you can help?

Tags
Scheduler
Asked by
Tim
Top achievements
Rank 1
Share this question
or