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

NavigatorBar Delete Button command

How i can customize the delete message alert pop up when I click on the delete button? I need to change the "Delete record?" message to an another one.

Thanks

4 Replies

SN Sridhar N Syncfusion Team May 28, 2012 05:54 AM UTC

Hi Fabio,

Thanks for your interest in Syncfusion products.

Your requirement to customize the Delete confirmation message can be achieved by setting the customized text to confirmDeleteMessage in grid object. Please refer the below code snippets.

[Script]

$(document).ready(function () {

var gridId = '<%=this.GridGroupingControl1.ClientID%>';

var gridTable;

gridTable = GetEGridTable($get(gridId));

var gridObj = gridTable.GetGridObj();

gridObj.confirmDeleteMessage = " Delete current record?";

});

 

For your convenience, we have created sample and the same can be downloaded from the following link.

http://www.syncfusion.com/downloads/Support/DirectTrac/91188/ButtonBar Delete-2064488978.zip

Please let me know if you have any other questions or concerns.

Regards,

Sridhar.N



FA Fabio May 30, 2012 07:58 AM UTC

Thanks for the response. Now i set my custom delete message but why when i click on the delete button the DataSourceControlRowDeleting event is not fired? I have no problem with the editing event which is raised when i click on the Edit button Command. If i put the delete command directly on any single row in the grid the DataSourceControlRowDeleting event is raised.

Thanks in advice





FA Fabio May 30, 2012 08:47 AM UTC

I have also an another question. Trying your example it works only if i don't use  grid paging. If i use it when i change the default message "Delete record" is used because the document.ready function is not called on page change. How i can solve it?

I solved for the DataSourceControlRowDeleting. The RecordDeleting is call on delete.

Thanks



SN Sridhar N Syncfusion Team June 4, 2012 06:29 AM UTC

Hi Fabio,

Thanks for your update.

We suspect that you are using UpdatePanel and so we suggest you to bind the DeleteConfirmationMessage on EndRequest. Please refer the below code snippet.

 

[Script]

$(document).ready(function () {

setConfirmationMessage();

});

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);

function EndRequest(sender, args) {

setConfirmationMessage();

}

function setConfirmationMessage() {

var gridId = '<%=this.GridGroupingControl1.ClientID%>';

var gridTable;

gridTable = GetEGridTable($get(gridId));

var gridObj = gridTable.GetGridObj();

gridObj.confirmDeleteMessage = " Delete current record?";

}

 

 

For your convenience, we have created sample and the same can be downloaded from the following link.

 

http://www.syncfusion.com/downloads/Support/DirectTrac/95077/ButtonBar Delete1638186371.zip

 

Please let me know if you have any other questions or concerns.

 

Regards,

Sridhar.N


Loader.
Live Chat Icon For mobile
Up arrow icon