This is a migrated thread and some comments may be shown as answers.
Binding Appointment Start and End problem
1 Answer 23 Views
This is a migrated thread and some comments may be shown as answers.
Softwel
Top achievements
Rank 1
Softwel asked on 20 Apr 2012, 10:49 AM
Hi,

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,

Wim

1 Answer, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 25 Apr 2012, 09:08 AM
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.

Greetings,
Yana
the Telerik team

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

Asked by
Softwel
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or