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. Image for the cookie policy date

Confirm dialog before delete SQL record.

Please, How I can do a confirm dialog in delete action. Delete is on a server side (ASP.NET Grid).
Thank you.
Peter

5 Replies

AS Alan Sangeeth S Syncfusion Team March 17, 2015 10:49 AM UTC

Hi Peter,

Thanks for using Syncfusion Products.

We are glad to let you know that we can achieve your requirement “Confirm Dialog before Delete” by using “ShowDeleteConfirmDialog” property of Grid EditSettings. Please refer the following code snippets.

<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" OnServerEditRow="EditEvents_ServerEditRow" OnServerAddRow="EditEvents_ServerAddRow" OnServerDeleteRow="EditEvents_ServerDeleteRow">

<EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True" ShowDeleteConfirmDialog="true"></EditSettings>

</ej:Grid>

For your convenience we have created a sample and the same can be downloaded from below location.

Sample: http://www.syncfusion.com/downloads/support/forum/118515/Sample-952039100.zip

Also please refer the following API documentation for further reference.

http://help.syncfusion.com/UG/JS_CR/ejGrid.html#editSettings-%3EshowDeleteConfirmDialog

Please let us know if you need any further assistance.

Regards,
Alan Sangeeth S




PE peterV March 17, 2015 06:37 PM UTC

Thank you for your answer, but I have a problem with "ShowDeleteConfirmDialog". Whem I setup to "True", during compilation in VS2003, all the Visual Studio does not respond. I must restart application. Then I set up to "False" it goes correct. The program is runnig OK. I can delete row, add, update, and export to Excel, but without a confirmation.
I send you in attachment code sample. (copy snipet).  I think, the best way is JS in client side event. I'll try.
Thank you for your interest.
Peter


AS Alan Sangeeth S Syncfusion Team March 18, 2015 07:35 AM UTC

Hi Peter,

Thanks for the update.

We are sorry to let you know that we are unable to reproduce the issue “Visual Studio does not respond when we set ‘ShowDeleteConfirmDialog’ as true”. We suspect that the Visual Studio Add-ins are the cause of the issue. Please refer the below general solutions to resolve the crash.

  1. Remove add-ins from the visual studio and restart the application will be prevent the visual studio crash.
  2. Repair the Visual Studio from the control panel will reset the application.

Please refer the below links to know further details about this.

https://social.msdn.microsoft.com/Forums/en-US/e8e23082-5828-49c6-a3b8-8050d31eaea1/visual-studiomsbuild-freezes-while-building?forum=vbide

https://msdn.microsoft.com/en-us/library/aa983433(v=vs.90).aspx

If your application still crash in your end after tried the above solutions, please get back to us with more information regarding your reported issue or else please provide us the video demonstration. It will be helpful for us to sort out the issue and provide youthe solution as soon as possible.

Please let us know if you have any concerns.

Regards,
Alan Sangeeth S




PE peterV March 20, 2015 09:33 PM UTC

I solved this:

<ClientSideEvents ActionComplete="complete" EndAdd="endAdd" EndDelete="endDelete" EndEdit="endEdit" ActionBegin="begin" />

</style>

<script type="text/javascript">

function endAdd(args) {

$("#OrdersGrid").ejWaitingPopup("show");

}

function endDelete(args) {

$("#OrdersGrid").ejWaitingPopup("show");

}

function endEdit(args) {

$("#OrdersGrid").ejWaitingPopup("show");

}

function complete(args) {

if (args.requestType == "refresh") {

$("#OrdersGrid").ejWaitingPopup("hide");

}

}

function begin(args) {

if (args.requestType == "delete") {

if (confirm("Are you sure, you want to delete the record?") == false) {

args.cancel = true;

}

}

}

</script>

BUT using ShowDeleteConirmDialog="True" is still problem, althrough program was running on another PC.
The solution described above is suitable for me.
Thanks
Peter


AS Alan Sangeeth S Syncfusion Team March 23, 2015 12:45 PM UTC

Hi Peter,
Thanks for the update.
We are happy to hear that you have resolved your issue using a workaround.
But we are deeply regret to let you know that we are unable to reproduce the issue “Visual Studio does not respond when we set ‘ShowDeleteConfirmDialog’ as true” in our end.
The Add-ins must be the problem in your end. So please repair or re-installyour Visual Studio to get it working properly.
Regards,
Alan Sangeeth S


Loader.
Live Chat Icon For mobile
Up arrow icon