We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Disable exit message

Thread ID:

Created:

Updated:

Platform:

Replies:

124123 May 18,2016 01:12 PM UTC Dec 11,2017 05:38 AM UTC WinForms 5
loading
Tags: ScheduleControl
Dario Fraschini
Asked On May 18, 2016 01:12 PM UTC

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.


Adhikesevan Kothandaraman [Syncfusion]
Replied On 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 


manoyanx
Replied On 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?

Arulpriya Ramalingam [Syncfusion]
Replied On 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;  
  
  
Please let us know the exact use case if we missed anything from your customization.  
  
Regards,  
Arulpriya 


manoyanx
Replied On December 8, 2017 04:08 PM UTC

It's working now.

Thanks!

Mohanraj Gunasekaran [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;