Retrieving the DialogResult in the ScheduleView's DialogClosing event

3 posts, 1 answers
  1. Rebecca
    Rebecca avatar
    28 posts
    Member since:
    Nov 2010

    Posted 07 Jan 2013 Link to this post

    Hi,

    I have implemented a method that handles my ScheduleView's DialogClosing event. In this method I am determining if the appointment about to be created overlaps with any other appointment and I am prompting the user to confirm their action if an overlap was detected since merging will take place.

    In the answer to this thread, Konstantina mentions that: "There in the event's arguments, the DialogResult shows whether the ok or cancel button has been clicked"; however, the CancelRoutedEventArgs does not have a DialogResult property and I cannot figure out how to retrieve the this information.

    So, my question is: how to you retrieve the DialogResult within the ScheduleView's DialogClosing event?

    I am looking forward to your advise.

    Thank you,

    -Rebecca
  2. Answer
    Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 10 Jan 2013 Link to this post

    Hi Rebecca,

    In order to be able to access the DialogResult property of the EventArgs you will have to parse them to CloseDialogEventArgs. Please find attached a sample application which illustrates this.

    Greetings,
    Konstantina
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Rebecca
    Rebecca avatar
    28 posts
    Member since:
    Nov 2010

    Posted 10 Jan 2013 Link to this post

    Thank you for your reply.

    You were right, simply casting the CancelRoutedEventArgs into a CloseDialogEventArgs worked:
    If CType(e, Telerik.Windows.Controls.CloseDialogEventArgs).DialogResult = True Then
      'The user did not cancel or close the dialog
    Else
      'The user responded yes to the dialog
    End If

    Thanks for your help!

    -Rebecca
Back to Top