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

Delete event not called.

7 Answers 111 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
hardik
Top achievements
Rank 1
hardik asked on 09 Apr 2011, 10:37 AM
Hi telerik,

I create one test application using scheudlerView.

I found one bug into it. When I click on the delete icon of appointment at that time AppointmentDeleting or AppointmentDeleted event not called. This is happen only when I cancel the  event

private void XamlRadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
    {
      // This will cancel default ScheduleView dialogs.
      e.Cancel = true;
    }

Is that any bug or I need to add some logic.?

Thanks
Hardik

7 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 13 Apr 2011, 02:40 PM
Hi hardik,

This is expected behavior, because when the user tries to delete an appointment, a confirmation dialog is shown first and after the deletion is confirmed, the events are fired. So when you cancel ShowDialog event, you prevent this dialog from displaying. In order to workaround this, you can set DefaultDialogResult property of the ShowDialogEventArgs to true like this:
 

private void XamlRadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
{
    e.DefaultDialogResult = true;
    e.Cancel = true;
}

All the best,
Yana
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
0
hardik
Top achievements
Rank 1
answered on 13 Apr 2011, 03:24 PM
Hi Yana

Its working now. Thank you so much.

Thanks
Hardik
0
hardik
Top achievements
Rank 1
answered on 14 Apr 2011, 08:30 AM
Hi yana,

As per your suggestion I do the code but now I am facing another problem with it.

After

private void XamlRadScheduler_ShowDialog(object sender, ShowDialogEventArgs e)
    {
      e.DefaultDialogResult = true;
      e.Cancel = true;
    }


this coding

deleting is called but appointment is deleted  temporarily(not shown) from there even though I select cancel from my own popup.After refreshing the schedulerView again that appointment is shown there.

Same problem I am facing with creating also when I double click in calendar then I cancel default popup by e.cancel = true. And from my popup I cancel the appointment creation than also one appointment is shown there. And after refreshing it will not whon there.

Same thing happen in test application also. I just done above coding and when I double click in scheudlerView then appointment is created. see the Image.

Thanks
Hardik
0
Yana
Telerik team
answered on 15 Apr 2011, 02:41 PM
Hi hardik,

The recommended approach to display custom appointment dialog is to change the EditAppointmentDialogStyle property of the ScheduleView control as described in this blog post.
You can use DeleteAppointmentConfirmDialogStyle property to customize the delete confirmation dialog.
Canceling ShowDialog event and displaying custom popups may have unpredictable results.

Please try the approach and let us know how it goes.

Greetings,
Yana
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
0
hardik
Top achievements
Rank 1
answered on 15 Apr 2011, 03:34 PM
thanks for reply.

I have solve the issue. e.cancel = true in XamlRadScheduleView_AppointmentEditing event and

 private void XamlRadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
    {
      // This will cancel default ScheduleView dialogs.
      e.DefaultDialogResult = true;
      e.Cancel = true;
    }

now its working.,

Thanks
Hardik
0
Marcus
Top achievements
Rank 1
answered on 14 Mar 2013, 09:38 AM
By the way: Is it possible to get to know which dialog is going to be shown inside the ShowDialogEvent?
0
Yana
Telerik team
answered on 18 Mar 2013, 09:44 AM
Hello Marcus,

You should check the DialogViewModel property of the ShowDialogEventArgs to find the dialog that will be shown. More information about ShowDialog event can be found here and here.

Greetings,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ScheduleView
Asked by
hardik
Top achievements
Rank 1
Answers by
Yana
Telerik team
hardik
Top achievements
Rank 1
Marcus
Top achievements
Rank 1
Share this question
or