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

Updating appointments on datasource change

3 Answers 106 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 22 Feb 2012, 11:13 AM
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

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 24 Feb 2012, 12:02 PM
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 >>
0
Marcel
Top achievements
Rank 1
answered on 07 Mar 2012, 05:12 PM
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
0
Miroslav Nedyalkov
Telerik team
answered on 08 Mar 2012, 09:50 AM
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 >>
Tags
ScheduleView
Asked by
Marcel
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Marcel
Top achievements
Rank 1
Share this question
or