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

How do you always edit series when editing a recurring appointment

13 Answers 221 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 29 Apr 2011, 02:10 PM
I am using the ScheduleView to allow the user to add and edit custom appointments.
These appointments are always recurring weekly.

Since the appointments are always recurring, I would like to always edit the series.
I'm not sure how to prevent the window that prompts the user to select whether edit the series or the individual appointment from opening...

I am looking for a way to always edit the series.

Thanks!

13 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 03 May 2011, 12:57 PM
Hello newbie,

I guess you can use the RecurrenceChoiceDialogStyle property of the ScheduleView and apply a new style to the dialog, without the option for editing the occurrence. For base you can use the default style of the dialog and edit its RecurrenceChoiceTemplate. You can find it in the ..\Telerik\RadControls for WPF Q1 2011 SP1\Themes\OfficeBlack\Themes\Office\Black\ScheduleView.xaml file.

Hope this information helps.

Kind regards,
Konstantina
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
0
newbie
Top achievements
Rank 1
answered on 05 May 2011, 05:20 PM
Thank you for your reply.

I have 2 problems with your suggestion.

The more obvious problem is that the user will be prompted unnecessarily when they double click on the appointment to edit it (I found a way to avoid this prompt when they drag the appointment to edit it). So, I am still very interested in hearing a suggestion that avoids this unnecessary prompt.

The second problem is that I am having a hard time setting the "edit series" to be selected by default. I was able to remove the "edit occurence" option completely from the dialog, but I can't figure out how to have the "edit series" selected by default...
0
newbie
Top achievements
Rank 1
answered on 05 May 2011, 05:47 PM
Edit: I thought I figured out a solution to my problem...I tried to:

Use a MultipleBinding  binding on the the "Edit Series" radio button option. I created a converter that always returns true.

However this did not work. The IsSeriesModSelected value remains "false" until I physically click on the radio button.

Thanks for your help
0
Yana
Telerik team
answered on 10 May 2011, 01:15 PM
Hello,

I would suggest a different approach in order to prevent the RecurrenceChoiceDialog from opening - just subscribe to ShowDialog event of the RadScheduleView and cancel it:

private void RadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
{
    if (e.DialogViewModel is RecurrenceChoiceDialogViewModel)
    {
        (e.DialogViewModel as RecurrenceChoiceDialogViewModel).IsSeriesModeSelected = true;
        e.DefaultDialogResult = true;
        e.Cancel = true;               
    }
}

Note that IsSeriesModeSelected property is set to true, so the "Edit Series" option will be always selected. Also DefaultDialogResult property needs to be set to true in order to show the EditAppointmentDialog.

Hope this helps.

Regards,
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
0
Martha
Top achievements
Rank 1
answered on 12 Aug 2011, 05:33 PM
I tried that suggestion and it works fine. I am using it to default the recurrence cancel choice to series mode.

BUT I only want to do this for certain appt types. So I check the appt & if it is that type of appt I set IsSeriesModeSelected = true, etc. But if I select to cancel an appt of that type, then I select to cancel an appt of another type where I want the recurrence choice dlg to be presented (not defaulted) it isn't even calling the ShowDialog event handler. It is just using the defaulted value from before. I have to cancel the cancel operation, then select to cancel the appt again then it shows the  recurrence choice dlg.

Is this a known bug?
0
Martha
Top achievements
Rank 1
answered on 12 Aug 2011, 05:40 PM
Clarification...

I am using a RadContextMenu to initiate the Cancel operation. When the user selects cancel from the popup menu I call

RadScheduleViewCommands.DeleteAppointment.Execute(null, Schedule);


If I just hit the delete key, the ShowDialog event handler is called just fine
0
Martha
Top achievements
Rank 1
answered on 12 Aug 2011, 06:28 PM
Update...

The only way I can get this to work is to left-click on the appt before I right-click to present the popup menu.
If I only right-click, the SelectedAppointment is the correct appt, but the entire appt. If I left-click first, the SelectedAppointment is the Occurrence which will cause the recurrence choice dlg to be shown.

It would be nice if we didn't have to force the user to left-click, then right-click to have the operation selected from the popup executed correctly.

Any help with this would be greatly appreciated.
0
Accepted
Pana
Telerik team
answered on 19 Aug 2011, 08:52 AM
Hi Martha,

You have the Appointment in the ViewModel. Please consider using the following handler for the ShowDialog:

private void RadScheduleView_ShowDialog(object sender, Telerik.Windows.Controls.ShowDialogEventArgs e)
{
    RecurrenceChoiceDialogViewModel rcdvm = e.DialogViewModel as RecurrenceChoiceDialogViewModel;
    if (rcdvm != null)
    {
        IAppointment app = rcdvm.Occurrence.Appointment;
        // TODO: do something with the app here
        rcdvm.IsSeriesModeSelected = true;
        e.DefaultDialogResult = true;
        e.Cancel = true;
    }
}

You should be able to auto cancel or not based on the app there. It should be reference to the Appointment to which the occurrence belong. This way you would not have to get the selected appointment and would be able to edit even non selected appointments.

Kind regards,
Pana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Martha
Top achievements
Rank 1
answered on 19 Aug 2011, 02:40 PM
LIke I said before I am implementing the ShowDialog event handler and cancelling the recurrence choice based on the appt.
But  it isn't even calling the ShowDialog event handler when I right click on the second appt to present the popup context menu.
I have to left click first then right-click for it to work properly.
0
Yana
Telerik team
answered on 24 Aug 2011, 01:16 PM
Hello Martha,

I've tried to reproduce this issue but without much success. Can you send us more details about your setup? Which version of the controls exactly you're using?

Greetings,
Yana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Martha
Top achievements
Rank 1
answered on 24 Aug 2011, 02:53 PM
Actually I just realized yesterday that this post was in the WPF forum. We are using SilverLight.

RadControls for Silverlight v2010.3 1314 2011-01-14


0
Yana
Telerik team
answered on 29 Aug 2011, 12:54 PM
Hi Martha,

It seems that you're using too old version of the control, is it possible for you to upgrade to Q2 2011 release? There is no such issue with ShowDialog event in the latest release.

All the best,
Yana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
newbie
Top achievements
Rank 1
answered on 29 Sep 2011, 08:59 PM
Thank you very much for your help Pana!


Tags
ScheduleView
Asked by
newbie
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
newbie
Top achievements
Rank 1
Yana
Telerik team
Martha
Top achievements
Rank 1
Pana
Telerik team
Share this question
or