Binding Appointments to Scheduleview After Service Call

3 posts, 0 answers
  1. Scott
    Scott avatar
    38 posts
    Member since:
    Sep 2012

    Posted 18 Nov 2014 Link to this post

    I'm working with a scheduleview in timeline mode.  I have a "name" resourcetype and group description so appointments should show up in the row corresponding to their resource.  Everything was working fine when I created this application with hard-coded dummy data.  I created the resources (a list of people), added them to a resource type which the scheduleview binds to, then created my appointments and assigned those resources to the appointments, which in turn the scheduleview also binds to.  This all works as expected and I get a nice scheduleview in timeline mode with a list of staff and their corresponding appointments.  The problem happens when I change the application to actually retrieve my data from a WCF service.  This is done asynchronously of course, and in the data complete event I'm updating my public Appointments property with the retrieved data.  However, the scheduleview is not updating and/or displaying the appointments.  I am implementing onpropertychanged in the Appointments property, and I did debug it and make sure the appointments from the service are received and being loaded into the Appointments property.  The UI just isn't displaying the appointments.  I do see all the resources listed on the scheduleview...just no appointments.  Am I missing something?  Let me know if you need more info.
    As always, thanks for your help!
  2. Yana
    Yana avatar
    4602 posts

    Posted 19 Nov 2014 Link to this post

    Hello Scott,

    As far as I understand you have Appointments property in the ViewModel, the AppointmentsSource of the ScheduleView is bound to it and the data is received asynchronously. If that's the case, please try to define the Appointments property initially as an empty ObservableCollection ( in the constructor of the ViewModel) and then just add the Appointments to it.

    If this does not help, I'd ask you to send us a small demo project where we could test the exact scenario. You should open a support ticket and attach it there.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Scott
    Scott avatar
    38 posts
    Member since:
    Sep 2012

    Posted 25 Nov 2014 in reply to Yana Link to this post

    Thanks Yana, I figured this out.  To anyone that might view this, my problem was that I wasn't using the same resource to attach to the resource type collection that I was using to attach to the appointment.  I was creating a new resource with the same name and resource type, but that doesn't work.  You have to actually use the same instance of the resource object to attach to both appointment and res. type collection.  I simply stored the resources in a global collection and attached them to both appointment and resource type collection.  It seems strange you have to do this would be easier if you could just attach a resource to an appointment and the scheduleview would be smart enough to know where the appointment ends up, but that doesn't appear to be the case.

    Thanks again!

Back to Top