Updating an appointment

1 posts, 0 answers
  1. Tim
    Tim avatar
    1 posts
    Member since:
    Oct 2011

    Posted 21 Oct 2011 Link to this post

    I've added a resource to the advanced form template as below

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

    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

Back to Top