Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Scheduler > Using SchedulerCommands

Not answered Using SchedulerCommands

Feed from this thread
  • Posted on Oct 7, 2008 (permalink)

    Hi,

    I'm using the latest build of the scheduler and have set up a custom view very similar to your customisation example.

    I need a Save / Cancel button etc. on the appointmentdialogwindow

    I added a button and set it's command to the saveappointment e.g.

     

    <

    Button Content="Save" Command="my:RadSchedulerCommands.SaveAppointment"></Button>

     


    and I assume i need to hook up the command binding on the page e.g.:

     

    CommandBinding cb = new CommandBinding(RadSchedulerCommands.SaveAppointment);

     

    cb.Executed +=

    new ExecutedRoutedEventHandler(cb_Executed);

     

     

    this.CommandBindings.Add(cb);

    and in my cb_Executed function i would call my save logic to write the appointment to the database etc?

    My cb_Executed isn't firing on the page.  Do i need ot add the binding somewhere else?
    If i add a button to the page (not the appointmentdialogwindow) the binding works.

     

    Reply

  • Posted on Oct 7, 2008 (permalink)

    Just wanted to clarify my question .. how do i attach to the save command. I want ot save the details to the db on save etc?

    Reply

  • Posted on Oct 8, 2008 (permalink)

    Found it myself..

     

    <

    Style x:Key="EditAppointment" TargetType="{x:Type my:AppointmentDialogWindow}">
    <

    EventSetter Event="AppointmentSaved" Handler="yourHandlerhere"></EventSetter>

     

    ....

    Reply

  • Jordan Jordan admin's avatar

    Posted on Oct 8, 2008 (permalink)

    Hello Bronwen,

    Please, accept my apologies for the delayed response. I saw that you had found a solution. It's great. It did not cross my mind.
    I have another solution for you. You can use RadScheduler's Appointments property. It inherits ObservableCollection<IAppointment> and you can subscribe to the CollectionChanged event. You can use it as shown in the following snippet:

     public Window1()

            {

                InitializeComponent();

     

                Scheduler.AppointmentProvider = new CustomProvider();

                Scheduler.Appointments.CollectionChanged += Appointments_CollectionChanged;

            }

     

            void Appointments_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)

            {

                foreach ( CustomAppointment appointment in e.NewItems )

                {

                    //Save in database

                }

            }

     
    We think about working with database. Our idea is to use AppointmentProvider to save, delete, update appointments in a store (database, file, etc.). We will try to extend it for the release version and add some samples with a custom database provider.

    We updated your Telerik points for your involvement.

    Best wishes,
    Jordan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Scheduler > Using SchedulerCommands
Related resources for "Using SchedulerCommands"

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