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

Implementing Delete From Button Outside the Appointment

0 Answers 75 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Mohammed
Top achievements
Rank 1
Mohammed asked on 08 Apr 2020, 10:43 AM

Hi,

Firstly I removed the delete button from Schedule view Appointments and I am trying to delete the Appointments using a button added in the UserControl to do the same.

 

From the code behind  I invoked the RecurrenceChoiceDialog as this below.

    Telerik.Windows.Controls.RadScheduleViewCommands.DeleteAppointment.Execute(ScheduleView, ScheduleView);

 

1) Actually I noticed that Whenever we selected the "DELETE THE SERIES"  -> AppointmentDeleting event of the schedule view is firing (Here I set a Boolean isSeriesSelectedForDelete as true).

2) Whenever I select "DELETE OCCURENCE" there is no event firing I noticed. But I have managed it by adding like this

            Telerik.Windows.Controls.RadScheduleViewCommands.DeleteAppointment.Execute(ScheduleView, ScheduleView);
            if (!isSeriesSelectedForDelete)
            {
                var check = vm.Appointments.First().RecurrenceRule.Exceptions.Any(x => x.ExceptionDate == vm.SelectedAppointment.Start);
                if (check)
                    vm.DeleteOccurenceOrSeries(false);
            }

 

I could have reduced a lot of codes like this. if I get a result from the dialog which includes whether the user is clicked OK or CANCEL which one is selected Series or Occurrence . I think my scenario is clear and you can help me out. 

 

Thanks.

No answers yet. Maybe you can help?

Tags
ScheduleView
Asked by
Mohammed
Top achievements
Rank 1
Share this question
or