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

Problem when saving Appointment

2 Answers 76 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Wayne
Top achievements
Rank 1
Wayne asked on 25 May 2011, 12:26 PM
Hi,

I am having a problem when saving some appointments. Most of the time it seems to work fine, however, on occasion the wrong values are being used when saving.

In my ViewModel I have a method which is bound to the appointment created event of the ScheduleView (this all works fine), however, on occasion, this method will receive data which does not match what appears on the UI prior to the save being clicked. The data appears to be the default values of the bound fields (E.g. a bound text box sometimes returns null for the text, and sometimes the date time picker for the start date returns the year 1000). So at a guess, I think that the save is running before the bindings have updated the source. I'm not sure how valid of a theory this is though.

FYI I have a custom appointment class that inherits AppointmentBase and a Custom appointment editor dialog. The majority of the time everything works without problem.

I'm not sure if this is a ScheduleView specific problem or a general Silverlight issue. Any advice would be useful.

2 Answers, 1 is accepted

Sort by
0
Wayne
Top achievements
Rank 1
answered on 26 May 2011, 01:03 AM
Update

The problem with the text fields not updating seems to only happen with when using the 'Enter' key to trigger the save button. When I click on the button it seems to work fine. I understand that textboxes only get updated when they lose focus, however I have checked and the textbox does indeed lose focus before the save method is run.

I am able to fix the problem by adding a click event handler to the Save button and calling UpdateSource() on each of the control's that have a binding, e.g.

textTitle.GetBindingExpression(TextBox.TextProperty).UpdateSource();

This does not really fit in with the MVVM approach though.
0
Yana
Telerik team
answered on 31 May 2011, 09:37 AM
Hello Wayne,

We're not aware of such an issue in RadScheduleView, please send us some sample code which will help us reproduce it. Thanks in advance

Best wishes,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ScheduleView
Asked by
Wayne
Top achievements
Rank 1
Answers by
Wayne
Top achievements
Rank 1
Yana
Telerik team
Share this question
or