Disable exit message
Hello, I'm trying to save the data of an appointment as I click "Save and Close".
It seems to work, but I have always the message "Do you want to save yout changes" when I close the form.
Why?
Is it possible to disable that message?
Thank you.
It seems to work, but I have always the message "Do you want to save yout changes" when I close the form.
Why?
Is it possible to disable that message?
Thank you.
SIGN IN To post a reply.
5 Replies
AK
Adhikesevan Kothandaraman
Syncfusion Team
May 19, 2016 10:28 AM UTC
Hi Dario,
Thanks for using Syncfusion products.
To close the form without showing the dialog box, use the “SaveOnCloseBehaviorAction” property value as “SaveWithoutPrompt”. It will commit the changes automatically to the data source while closing the form.
Please refer to the following code snippet,
//To save the changes without showing the message box
this.scheduleControl1.DataSource.SaveOnCloseBehaviorAction = SaveOnCloseBehavior.SaveWithoutPrompt;
Regards,
Adhi
MA
manoyanx
December 7, 2017 03:01 PM UTC
Hi,
I already applied this code
this.scheduleControl1.DataSource.SaveOnCloseBehaviorAction = SaveOnCloseBehavior.SaveWithoutPrompt;
If the user will not open any appointment, the Prompt will not appear. However, If the user tries to create a new Appointment or view an existing one, the prompt will appear again upon close.
How do I disable this one? Is it because I am using a custom Appointment window?
AR
Arulpriya Ramalingam
Syncfusion Team
December 8, 2017 12:22 PM UTC
Hi Renegene,
Thanks for your update.
We have analyzed your scenario. We suspect that you are adding a new DataSource provider to the scheduler control after adding the appointment by using your custom appointment form. So, the DataProvided for the scheduler is initialized again and the default value of SaveOnCloseBehaviorAction property is updated as PromptBeforeSave. In order to resolve the issue, we would suggest you to reset the data source by using the ResetProvider() method and the SaveOnCloseBehaviorAction property of DataProvider can be set as SaveWithoutPrompt to disable the save dialog on closing the form. We have created a simple sample as per your requirement. Please make use of below code and sample,
Code example
|
//In custom appointment, to reset the data provider
//After adding the appointment to the DataSource
this.schedulegrid.ResetProvider(this.schedulegrid.ScheduleType);
//In Form, to disable the save dialog on close
this.scheduleControl1.DataSource.SaveOnCloseBehaviorAction =SaveOnCloseBehavior.SaveWithoutPrompt; |
Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/CustomAppointment-857970590
Please let us know the exact use case if we missed anything from your customization.
Regards,
Arulpriya
MA
manoyanx
December 8, 2017 04:08 PM UTC
It's working now.
Thanks!
MG
Mohanraj Gunasekaran
Syncfusion Team
December 11, 2017 05:38 AM UTC
Hi Renegene,
Thanks for your update.
We are glad to know that your reported problem has resolved.
Please let us know if you have any concerns.
Regards,
Mohanraj G
SIGN IN To post a reply.
- 5 Replies
- 5 Participants
-
DF Dario Fraschini
- May 18, 2016 01:12 PM UTC
- Dec 11, 2017 05:38 AM UTC