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

Retrieving the DialogResult in the ScheduleView's DialogClosing event

2 Answers 79 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Rebecca
Top achievements
Rank 1
Rebecca asked on 07 Jan 2013, 04:35 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Konstantina
Telerik team
answered on 10 Jan 2013, 12:48 PM
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.

0
Rebecca
Top achievements
Rank 1
answered on 10 Jan 2013, 02:15 PM
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
Tags
ScheduleView
Asked by
Rebecca
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Rebecca
Top achievements
Rank 1
Share this question
or