Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Scheduler > Create new AppointmentDialogWindow

Not answered Create new AppointmentDialogWindow

Feed from this thread
  • Rahul avatar

    Posted on Jun 9, 2010 (permalink)

    Hi,
    I want to create new window from  AppointmentDialogWindow .
    I want to set DataContext of my new window to my custom view model class.
    How to do this?


    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Jun 14, 2010 (permalink)

    Hello Rahul,

    To achieve your goal you have to use the EditAppointmentStyle property of the control.
    Please refer to the following help articles for more details:
    http://www.telerik.com/help/wpf/radscheduler-styling-edit-appointment-dialog.html
    http://www.telerik.com/help/wpf/scheduler-templates.html
    Then, to set a DataContext of the Dialog you can assign it to the Grid, which holds the controls:
    <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch"   
                            DataContext="{TemplateBinding EditedAppointment}"
                            Background="{TemplateBinding Background}">

    If you need further assistance please let us know.

    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.

    Reply

  • Yu avatar

    Posted on Aug 16, 2011 (permalink)

    Sorry can you elaborate? Where to define EditedAppointment?

    I'm using a view model for the scheduler (SchedulerViewModel). Inside this view model I defined a property called EditedAppointmentViewModel.

    I need to use this EditedAppointmentViewModel as the data context of the AppointmentDialogWindow.

    How to define the binding?

    Thanks.

    Reply

  • Yu avatar

    Posted on Aug 17, 2011 (permalink)

    Anyway, I was in a rush to solve it so I did it in a quick and dirty way.

    I addeda  Grid_Loaded event handler to the Grid and inside I assigned the view model (DataContext)'s property to the Grid as DataContext. This way, every time the user open an appointment dialog window, I get to update the view model of it.

    Just to put it down here. All feedbacks are welcome.

    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Aug 17, 2011 (permalink)

    Hi Yu,

    We are glad that you have resolved the issue yourself.

    Yes, this is a nice way to change the ViewModel. Thank you for sharing it with us.

    All the best,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Scheduler > Create new AppointmentDialogWindow
Related resources for "Create new AppointmentDialogWindow"

WPF Scheduler Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]