How to change the text on Kendo UI Grid destroy or delete command action?

Rodney picture Rodney · Sep 24, 2012 · Viewed 23.2k times · Source

I'm using a KendoUI KendoGrid. I have a column with delete button or "destroy" action. Kendo displays an alert box with the text "Are you sure you want to delete this record?" I need this text to be more specific to my situation. How do you customize this text?

Any help would be appreciated.

My code for adding the columns is:

$reports.kendoGrid(
{
    dataSource: dataSource,
    pageable: {
        refresh: true,
        pageSizes: true
    },
    toolbar: [{ name: "create", text: "Add" }],
    columns:
    [
        { field: 'name', title: 'Report', sortable: true },
        { command: ["edit", "destroy"], title: " ", width: "180px", } 
    ],
    editable: "inline",
    selectable: true,

Answer

Vlad Bezden picture Vlad Bezden · Mar 12, 2013

If you are using Kendo UI for ASP.NET MVC you can use DisplayDeleteConfirmation

        @(Html.Kendo().Grid<OrdersViewModel>()
              .Name("Orders")
              .HtmlAttributes(new {style = "height: 100%; border-width: 0;"})
              .Columns(c =>
                  {
                     c.Bound(p => p.Id)
                     .Width(50)
                  }
             .Editable(editable =>
                  {
                     editable.Mode(GridEditMode.InLine);
                     editable.DisplayDeleteConfirmation("Your Message here");
                  }))