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

Custom content of EditAppointmentDialog

1 Answer 30 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Sueleyman
Top achievements
Rank 1
Sueleyman asked on 11 Apr 2016, 09:48 AM

Hi,

I'm try to customize the dialog to create or edit appointments if I do a coubleclick on the schedule. 

I try two approches.

1. Create a EditAppointmentDialogStyle and EditAppointmentTemplate. So the template shows the content what I want. But I can't set a custom header on the dialog over the EditAppointmentDialogStyle .

2. Create a custom ScheduleViewDialogHostFactory. Here is the problem that I can't set a custom control as a template.

protected override IScheduleViewDialogHost CreateNew(ScheduleViewBase scheduleView, DialogType dialogType)       {           var window = new ShiftWindowDialogHost()           {               

             //                Content = new SchedulerDialog(),               

          Content = ServiceLocator.Current.GetInstance<UserManagement>(),               

            ScheduleView = scheduleView,               

             Header = "What a charm"           };           

    StyleManager.SetThemeFromParent(window, scheduleView);           

return window;       }

I get the exception

System.InvalidOperationException: 'SchedulerDialog' TargetType does not match type of element '.
   at System.Windows.Style.CheckTargetType(Object element)

 

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 14 Apr 2016, 07:30 AM
Hi Sueleyman,

Indeed in order to achieve the desired appearance for the header of the EditAppointmentDialog a custom ScheduleViewDialogHostFactory should be created. We tried to reproduce the observed by you error but it seems everything is working as expected for us.

We have created a sample project that demonstrates how such custom created ScheduleViewDialogHostFactory works on our side - the project uses Implicit Styles
that is the approach we suggest for using when Styles needs to be modified instead of using StyleManager (which is the old technique used for applying themes). Please, check the attached project.

We hope this will help you.

Regards,
Nasko
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
ScheduleView
Asked by
Sueleyman
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or