Updating appointments on datasource change

4 posts, 0 answers
  1. Marcel
    Marcel avatar
    21 posts
    Member since:
    Feb 2007

    Posted 22 Feb 2012 Link to this post

    Hello,

    I've got a problem when i update a record in my scheduleviewsource.
    When is set the border property in one of the appointments the border shows correctly the first time.
    But when i set it to another appointment in the source it wont update.

    I have to change the viewdefinitions before and then it updates. But this is slow because of the amount of resources ive selected.
    s.ActiveViewDefinition = s.ViewDefinitions[2];

    s.UpdateLayout();

    s.ActiveViewDefinition = s.ViewDefinitions[0];

    s.UpdateLayout();

    Is there another way to rebind the view?

    Greetings
    Marcel de Groot
    Abecon

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 24 Feb 2012 Link to this post

    Hello Marcel,

    You could use the editing mechanism we use internally when updating properties of the appointments. What you need to do is to call the BeginEdit method of the RadScheduleView control before changing the appointment and Commit method - when you want to commit the change. This will force the RadScheduleView to update. For more information about appointment editing you could find here.

    Hope this helps.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Marcel
    Marcel avatar
    21 posts
    Member since:
    Feb 2007

    Posted 07 Mar 2012 Link to this post

    Hello Miroslav,
    Too bad, no result. I must be doing something wrong.
    I've got a testbutton wich does this:
    foreach (var i in schedulerResource.AppointmentsSource)
      { var item = (SessionAppointment)i;
     if (item.Start.Date == DateTime.Now.Date)
     {
     blnRefresh = true;
     if (schedulerResource.BeginEdit(item))
     {
     item.BorderVisible = true;
     item.BorderRelatedVisible = false;
     }
     schedulerResource.Commit();
      
    }
      
    }
      
    }

    Again if i switch days after this action the update is visible.
    Please help me with this problem.

    Greetings
    Marcel de Groot
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 08 Mar 2012 Link to this post

    Hellow Marcel,

    These properties you set are not part of the properties the ScheduleView reads when it renders its items. What I guess is that you use these properties in your style selectors to set different styles for these items. In this case the editing engine will not help as it reuses the visible containers.

    Could you please prepare us a sample project the demonstrates this issue as without such project we are shooting in the dark.

    All the best,
    Miroslav Nedyalkov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top