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

Set default RecurrenceRangeType

4 Answers 54 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Jose
Top achievements
Rank 1
Jose asked on 17 May 2017, 10:35 AM
Hello,

I have overriden  the EditRecurrenceTemplate in order to force that every appointment with recurrence must have a RecursUntil Date.

What I have done, in the RangeGroup, is removing the radiobuttons that I won't use:

"NoEndDate"

"EndAfter"

So I only have the "EndBy" radiobutton

If I'm editing a recurrence and I check (manually) the radiobutton, everything works fine. Exactly what I want is to extract :

Appointment.RecurrenceRule.Pattern.RecursUntil

but I don't want to check the radiobutton everytime, so I have tried changing the radiobutton for a label or setting the radiobutton IsChecked property to True, but with both options, I get:

Appointment.RecurrenceRule.Pattern.RecursUntil= null

How can i check that button programmatically?

Or maybe made it set but setting the Appointment.RecurrenceRule.Pattern.RecursUntil to the value?



Thanks in advance

Hello,

I have overriden  the EditRecurrenceTemplate in order to force that every appointment with recurrence must have a RecursUntil Date.

What I have done, in the RangeGroup, is removing the radiobuttons, so I won't use:

"NoEndDate"

"EndAfter"

 

So I only have the "EndBy" radiobutton

 

If I'm editing a recurrence and I check (manually) the radiobutton, everything works fine. Exactly what I want is to extract :

Appointment.RecurrenceRule.Pattern.RecursUntil

but I don't want to check the radiobutton everytime, so I have tried changing the radiobutton for a label or setting the radiobutton IsChecked property to True, but with both options, I get:

Appointment.RecurrenceRule.Pattern.RecursUntil= null

 

How can i check that button programmatically?

Or maybe made it set but setting the Appointment.RecurrenceRule.Pattern.RecursUntil to the value?

 

Thanks in advance

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 22 May 2017, 09:42 AM
Hello Jose,

Indeed, if you set RecursUntil property of the RecurrencePattern the RadioButton should appear selected when the dialog is opened. Can you please give it a try and let us know if it work as expected?

Hope this will work for you.

Regards,
Kalin
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Jose
Top achievements
Rank 1
answered on 22 May 2017, 10:11 AM

Hello,

The problem that I have found is that I don't want to set the RecursUntil property of every appointment, just them that have recurrence. How can I catch the event that occurs when edit recurrence dialog is opened?

 

Thanks 

0
Kalin
Telerik team
answered on 24 May 2017, 08:03 AM
Hi Jose,

RadScheduleView fires the ShowDialog event whenever any dialog is being opened. Afterwards by checking the DialogViewModel property from the event arguments you could find out which dialog exactly is currently open. Using this approach you would be able to set the initial value of the RecurrenceRangeType as shown below:

private void scheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
{
    var dialogViewModel = e.DialogViewModel as RecurrenceDialogViewModel;
    if (dialogViewModel != null)
    {
        dialogViewModel.RecurrenceRangeType = RecurrenceRangeType.RepeatUntil;
    }
}


This should allow to achieve the desired scenario. If you have any other questions please let us know.

Regards,
Kalin
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Jose
Top achievements
Rank 1
answered on 24 May 2017, 11:12 AM

That worked great!

Thanks!

Tags
ScheduleView
Asked by
Jose
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Jose
Top achievements
Rank 1
Share this question
or