Hello,
I'm trying to replace the window that appears on AppointmentEditing event of the radscheduleview.
I'm updating an appointment, then I try to commit the changes with .Commit() method (which actually returns false -> there must be an error in this method, but I can't see it :P )
I'll give you a code snippet of what i'm trying to do:
I've tried every single thing on your forum but I haven't manage to make it work.
Please help me with the above issue, it's VERY annoying.
I'm trying to replace the window that appears on AppointmentEditing event of the radscheduleview.
I'm updating an appointment, then I try to commit the changes with .Commit() method (which actually returns false -> there must be an error in this method, but I can't see it :P )
I'll give you a code snippet of what i'm trying to do:
private
void
AppointmentEditingHandler(
object
sender, AppointmentEditingEventArgs e)
{
try
{
...
var appointment = e.Appointment;
...
var radScheduleView = (RadScheduleView)e.Source;
appointment.BeginEdit();
appointment.Start = newStartDateTime;
appointment.End = newStopDateTime;
appointment.Subject = courseTypeToString;
appointment.EndEdit();
radScheduleView.Commit();
e.Handled =
true
;
e.Cancel =
true
;
e.RoutedEvent =
null
;
}
catch
(exception ex)
{}
I've tried every single thing on your forum but I haven't manage to make it work.
Please help me with the above issue, it's VERY annoying.
6 Answers, 1 is accepted
0
Hi Nadisan,
Could you try with this:
radScheduleView.BeginEdit(appointment);
appointment.Start = newStartDateTime;
appointment.End = newStopDateTime;
appointment.Subject = courseTypeToString;
radScheduleView.Commit();
You should not call BeginEdit/EndEdit on the appointment. They are called internally when you call BeginEdit/Commit/Cancel on RadScheduleView.
Kind regards,
Valeri Hristov
the Telerik team
Could you try with this:
radScheduleView.BeginEdit(appointment);
appointment.Start = newStartDateTime;
appointment.End = newStopDateTime;
appointment.Subject = courseTypeToString;
radScheduleView.Commit();
You should not call BeginEdit/EndEdit on the appointment. They are called internally when you call BeginEdit/Commit/Cancel on RadScheduleView.
Kind regards,
Valeri Hristov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Nadisan
Top achievements
Rank 2
answered on 20 Dec 2011, 12:58 PM
Hello Valeri Hristov,
If i call radScheduleView.BeginEdit(appointment); then the main method
So, the xaml looks like:
If i call radScheduleView.BeginEdit(appointment); then the main method
AppointmentEditingHandler
is called again, I think I forgot to specify the contains of the Scheduleview.xaml.So, the xaml looks like:
<
Controls:RadScheduleView
x:Name
=
"Scheduler"
IsInlineEditingEnabled
=
"False"
AppointmentsSource
=
"{Binding Appointments}"
AppointmentEditing
=
"AppointmentEditingHandler"
>
<
Controls:RadScheduleView.ViewDefinitions
>
<
Controls:DayViewDefinition
/>
<
Controls:WeekViewDefinition
/>
<
Controls:MonthViewDefinition
/>
</
Controls:RadScheduleView.ViewDefinitions
>
</
Controls:RadScheduleView
>
0
Hello Nadisan,
You should not call BeginEdit/Commit in the editing events of RadScheduleView. The control supports only one appointment in edit mode, hence when you call BeginEdit again the previously edited appointment changes are cancelled.
The recommended way to customize the RadScheduleView dialogs is described here (you still can edit only one appointment at a time):
http://www.telerik.com/help/silverlight/radscheduleview-features-custom-dialogs.html
Best wishes,
Valeri Hristov
the Telerik team
You should not call BeginEdit/Commit in the editing events of RadScheduleView. The control supports only one appointment in edit mode, hence when you call BeginEdit again the previously edited appointment changes are cancelled.
The recommended way to customize the RadScheduleView dialogs is described here (you still can edit only one appointment at a time):
http://www.telerik.com/help/silverlight/radscheduleview-features-custom-dialogs.html
Best wishes,
Valeri Hristov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Nadisan
Top achievements
Rank 2
answered on 20 Dec 2011, 01:21 PM
Hello Valeri Hristov,
I don't want to edit more than one appointment.
What I've noticed is that if I leave the RoutedEvent not null
Then the default appointment editor is shown. If I press the "Ok" button, then the scheduleView will update with the values I've set in code behind (same thing happens if I surf throw ViewDefinintions: DayViewDefinition -> WeekDefinition -> DayViewDefinition => view updated with the values I've assigned in code behind).
There must be a way for me to update the schedule view UI.
Thanks for your support!!!
I don't want to edit more than one appointment.
What I've noticed is that if I leave the RoutedEvent not null
// e.RoutedEvent = null;
There must be a way for me to update the schedule view UI.
Thanks for your support!!!
0
Nadisan
Top achievements
Rank 2
answered on 20 Dec 2011, 04:04 PM
I still need support for this thread, please.
0
Nadisan
Top achievements
Rank 2
answered on 29 Dec 2011, 02:24 PM
I've found an ugly work-around for this issue:
var selectedIndex = radScheduleView.ActiveViewDefinitionIndex;
radScheduleView.ActiveViewDefinitionIndex = selectedIndex < 1 ? selectedIndex + 1 : selectedIndex - 1;
radScheduleView.ActiveViewDefinitionIndex = selectedIndex;