Custom content of EditAppointmentDialog

2 posts, 0 answers
  1. Sueleyman
    Sueleyman avatar
    6 posts
    Member since:
    Nov 2015

    Posted 11 Apr Link to this post


    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)


  2. Nasko
    Nasko avatar
    556 posts

    Posted 14 Apr Link to this post

    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.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft banner
Back to Top