This is a migrated thread and some comments may be shown as answers.
ConfirmDialogViewModel doesn't know SelectedAppointment
1 Answer 14 Views
This is a migrated thread and some comments may be shown as answers.
Art Kedzierski
Top achievements
Rank 2
Art Kedzierski asked on 15 Apr 2014, 06:53 PM
I'm trying to customize the Delete confirmation dialog of the RadScheduleView by passing some info about the selected appointment into ConfirmDialogViewModel.AdditionalData, but I'm hitting an order of events issue. When the user clicks the 'x' of an appointment in the ScheduleView, it fires the appropriate ShowDialog event. This seems to occur before the AppointmentDeleting event which is where I would expect to access details of the selected appointment. There is no SelectedAppointment available in the ShowDialog viewmodel at that time that I can find. 

public void Appointment_ShowDialog(object sender, ShowDialogEventArgs e)
{
    var confdvm = e.DialogViewModel as ConfirmDialogViewModel;
    if (confdvm != null)
    {
        var delAppt = ((RadScheduleView)sender).SelectedAppointment as GLMAppointment;
    }
}

How do I get details of the appointment clicked for deletion at this point in the lifecycle?It looks like the normal order of events is as follows:

  1. ShowDialog
  2. AppointmentDeleting
  3. AppointmentDeleted
Is this correct?

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 16 Apr 2014, 02:48 PM
Hi Art,

The SelectedAppointment might be null when the Delete button is clicked. However, you could get the appointment on which the delete button is clicked in the ShowDialog event, for example:

private void RadScheduleView_ShowDialog(object sender, Telerik.Windows.Controls.ShowDialogEventArgs e)
       {
           var viewModel = ((Telerik.Windows.Controls.ScheduleView.ConfirmDialogViewModel)(e.DialogViewModel));
           var app = viewModel.Appointments.FirstOrDefault();
       }

Hope this helps.

Regards,
Konstantina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Asked by
Art Kedzierski
Top achievements
Rank 2
Answers by
Konstantina
Telerik team
Share this question
or