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

EditRecurrenceDialog

8 Answers 166 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Martin Lundgard
Top achievements
Rank 2
Martin Lundgard asked on 12 Sep 2009, 06:26 PM
I'm supplying a translation to the radscheduler, but some of the translations need more space, especially on the editrecurrancedialog.
I already have provided a custom appointment that inherits from Telerik.WinControls.UI.Appointment successfully and provided a custom editappointmentdialog that inherits from Telerik.WinControls.UI.Scheduler.Dialogs.EditAppointmentDialog for editing.
How can i do the same for editrecurrencedialog?

I found I can inherit a form the same way as with the editappointmentdialog, but which event/property do I need to override/set to load my new editrecurrencedialog?

On a side note, I also would like to know what procedure you recomment to utilize the possibility for more than one resource. I.e. add a "More..." button behind the resource combo with it's own form? How would this affect the cmbResource when more than one resource is selected?

Using Winforms Q2 2009, VS2008

8 Answers, 1 is accepted

Sort by
0
Matthew Green
Top achievements
Rank 1
answered on 14 Sep 2009, 04:23 PM
To replace the default Recurrence Dialog:

1. Open you edited Appointment Dialog
2. Overide the following function:
public void ShowRecurrenceDialog() 
        { 
            //Dialog automatically adjusts the Recurrence rule of the Current Entity
            using (var recurrenceDialog = new Forms.Scheduling.AppointmentRecurrence(this.CurrentAppointmentEntity)) 
            { 
                recurrenceDialog.ShowDialog(); 
            } 
        } 

The above Forms.Scheduling.AppointmentRecurrence is inheriting the default EditAppointmentRecurrence. Feed the appointment into the constructor and the dialog will do the rest for you. 

For the second note about selecting more than one resource I cant help too much. Its to my knowledge grouping resources will be implemented in a later date. So i would recommend managing this yourself, hiding the current resource controls and adding an extra dialog / control to manage it how you would like. As I havnt needed this part yet i can only put this as a suggestion and hope someone else has a good solution to it.

Hope this is some help,
Matthew
0
Martin Lundgard
Top achievements
Rank 2
answered on 15 Sep 2009, 08:13 AM
It's a good way there atleast, hope there will be a solution for more resources soon :-)
0
Accepted
Jordan
Telerik team
answered on 16 Sep 2009, 12:36 PM
Hi Arve Asheim,

You can override ShowRecurrenceDialog method if you want to change the behavior associated with showing the recurrence dialog (like cloning the appointment object and then setting the properties back to the appointment edit dialog if the user pressed OK).

If you want to just change the recurrence dialog you can override CreateRecurrenceDialog method which in its default implementation looks like this:

protected virtual IEditRecurrenceDialog CreateRecurrenceDialog(IEvent recurringAppointment) 
        { 
            EditRecurrenceDialog editRecurrenceDialog = new EditRecurrenceDialog(recurringAppointment); 
            return editRecurrenceDialog; 
        } 

A new UI will be needed in order to be able to select more than one resource. A combo box with check box items could be used for that purpose. Or as Matthew suggested - another form.

All the best,
Jordan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jim
Top achievements
Rank 1
answered on 08 Sep 2010, 09:59 PM
I have overridden the EditRecurrenceDialog, and want the start and end datetimes entered there to be communicated back to the EditAppointmentDialog when I click the OK button. I know that the EditRecurrenceDialog constructors take an Appointment argument, but there is no obvious connection back to the EditAppointmentDialog. I find that the datetimes I enter in my custom EditRecurrenceDialog are not reflected in the EditAppointmentDialog. Somebody has been down this path. Help would be welcome. Thanks!
0
Dobry Zranchev
Telerik team
answered on 14 Sep 2010, 08:23 AM
Hi revox,

Thank you for writing.

You could customize also the EditAppointmentDialog and override its ShowRecurrenceDialog method. In this method you can take the date from the your custom EditRecurrenceDialog.
class CustomEditAppoinentDialog: EditAppointmentDialog
{
    IEditRecurrenceDialog recurrenceDlg;
    public override void ShowRecurrenceDialog()
    {
        base.ShowRecurrenceDialog();
 
        //do your changes here
        //cast recurrenceDlg to your custom type and take its fields
    }
    protected override IEditRecurrenceDialog CreateRecurrenceDialog(IEvent recurringAppointment)
    {
        this.recurrenceDlg = base.CreateRecurrenceDialog(recurringAppointment);
        return this.recurrenceDlg;
    }
}

I hope that this will help you. For other questions, feel free to write back.

Sincerely yours,
Dobry Zranchev
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
Jim
Top achievements
Rank 1
answered on 14 Sep 2010, 10:51 PM
Thanks! I've experimented with overriding these methods but simply need to revisit the topic and get it right. Your confirmation helps a lot.
0
Jim
Top achievements
Rank 1
answered on 17 Sep 2010, 03:53 PM
I got back to this and found your suggestions very helpful. In ShowRecurrenceDialog, I load data from the custom recurrence dialog to the custom appointment dialog. Works great!
0
Dobry Zranchev
Telerik team
answered on 20 Sep 2010, 09:47 AM
Hello revox,

Thank you for writing me back. I am glad to hear that you solved the issue. Should you have further questions, feel free to contact me.

Regards,
Dobry Zranchev
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
Scheduler and Reminder
Asked by
Martin Lundgard
Top achievements
Rank 2
Answers by
Matthew Green
Top achievements
Rank 1
Martin Lundgard
Top achievements
Rank 2
Jordan
Telerik team
Jim
Top achievements
Rank 1
Dobry Zranchev
Telerik team
Share this question
or