TemplateSelector MVVM

2 posts, 0 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 16 Oct 2012 Link to this post


    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).

  2. Victor
    Victor avatar
    1349 posts

    Posted 19 Oct 2012 Link to this post

    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.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top