Delete event not called.

8 posts, 0 answers
  1. hardik
    hardik avatar
    57 posts
    Member since:
    Feb 2011

    Posted 09 Apr 2011 Link to this post

    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
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 13 Apr 2011 Link to this post

    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
  3. DevCraft banner
  4. hardik
    hardik avatar
    57 posts
    Member since:
    Feb 2011

    Posted 13 Apr 2011 Link to this post

    Hi Yana

    Its working now. Thank you so much.

    Thanks
    Hardik
  5. hardik
    hardik avatar
    57 posts
    Member since:
    Feb 2011

    Posted 14 Apr 2011 Link to this post

    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
  6. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 15 Apr 2011 Link to this post

    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
  7. hardik
    hardik avatar
    57 posts
    Member since:
    Feb 2011

    Posted 15 Apr 2011 Link to this post

    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
  8. Marcus
    Marcus avatar
    35 posts
    Member since:
    Aug 2012

    Posted 14 Mar 2013 Link to this post

    By the way: Is it possible to get to know which dialog is going to be shown inside the ShowDialogEvent?
  9. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 18 Mar 2013 Link to this post

    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.

Back to Top
DevCraft banner