Binding Appointment Start and End problem

2 posts, 1 answers
  1. Softwel
    Softwel avatar
    5 posts
    Member since:
    Apr 2012

    Posted 20 Apr 2012 Link to this post


    I'm using the trial of Telerik Silverlight Version: Q1 2012 (v2012.1.215, Feb. 15, 2012)

    I have the following situation:
    I've overwritten the AppointmentCreating of the scheduler, adding my own dialog window. In the constructor of this window I pass the IAppointment object I receive from the AppointmentCreatingEventArgs (-> e.Appointment).
    I have added a property in my own dialog called Appointment, and in the constructor it receives the value of the IAppointment that is created. So far all good.

    In my custom dialog I have added a RadDateTimePicker to display the start time of the appointment that's been added. I tried binding the value of the Appointment to it, like so:
    SelectedValue="{Binding ElementName=SSID, Path=Appointment.Start}"

    This does not work. For some reason it keeps printing 1/01/1000 0:00 (so the binding works, but the value is incorrect). So looking through the debugger I found the following (see attachment).

    The property Start has the correct value, but the local variable start has the wrong value.
    Apparently start (the variable) is taken to complete the binding and not Start (the property), which is understandable since VB.NET doesn't have capitalisation, but problematic since it contains an incorrect value..

    This is the case when getting the object from the AppointmentCreatingEventArgs, so even without assigning it the problem exists.

    Any ideas how I can complete this binding without having to do
    dpStartTijd.SelectedValue = Appointment.Start
    which does work correctly?

    Much appreciated,

  2. Answer
    Yana avatar
    4604 posts

    Posted 25 Apr 2012 Link to this post

    Hi Win,

    The recommended way to customize the EditAppointmentDialog is setting the EditAppointmentDialogStyle property of the ScheduleView as explained here. You can add/remove controls from the dialog to achieve exactly the needed layout and also the bindings will be correct, because the dialog has the correct ViewModel set.

    If you still do not want to use this approach, please open a support ticket and send us a simple example demonstrating the issue with the binding.

    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top