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

[Solved] TemplateSelector MVVM

1 Answer 114 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ManniAT
Top achievements
Rank 2
ManniAT asked on 16 Oct 2012, 03:59 PM
Hi,

I have two questions.
The first is about DataBinding.

I saw that (Instead of "simple Binding") you use some special kind of Datasource.
So how can I achieve a binding to an ObservableCollection<IAppointment>.

In my scenario I get (from a WebService) a list of appointments.
And (must work too) a user can edit an appointment. So the subject and also the time (date) can change.

Next - about the ItemTemplateSelector.
It works - in general.
But my problem is that the display has to change on data.
Or in other words, I have intervals and the base of it changes - also through a webservice (and local via editing).

An example - Starting with a given date I have to display the other days with different images.
Imagine - on odd days have to display an X-Image and on even days an Y-I,age.
But the thing is - odd / even means the distance to a base date (which is data bound).

When I change the month (after setting this initial date) the things work.
But neither setting a new AppointmentSource nor setting a different DataContext (I just tried this to see if it works) forces a redraw.

How can I force a redraw in such a situation?
And (above) - how can I bind to a "normal Datasource" (ObservableCollection).

Manfred

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 19 Oct 2012, 02:19 PM
Hi Manfred,

Thanks for writing.
The calendar should update itself when the DataLoaded event of the appointment source is fired. Please try firing the event whenever your observable collection changes.

Please write again if you need further assistance.

Regards,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Calendar
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Victor
Telerik team
Share this question
or