This is a migrated thread and some comments may be shown as answers.

[Solved] How to change the 'Update' button text in the Insert popup in KendoGrid ?

2 Answers 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Frederic
Top achievements
Rank 1
Frederic asked on 19 Feb 2013, 06:53 PM
Hi, I have a kendo grid with Insert button in toolbar, and I want to change the text of the "Update" and "Cancel" buttons inside the popup window (I want to display "Save" instead of "Update"). Note that I don't want to show "Edit" button in the grid, so I don't have any command column.
I don't find anything on how to change those buttons.
Here is my code :
Html.Kendo().Grid(Of DetailTemplateEdit.Data.Person) _
    .Name("PersonsGrid") _
    .Columns(Function(columns) _
    { _
        columns.Bound(Function(p) p.Id).Hidden("true"), _
        columns.Bound(Function(p) p.Name), _
        columns.Bound(Function(p) p.GenreId).Hidden("true"), _
        columns.Bound(Function(p) p.CityId).Hidden("true"), _
        columns.Bound(Function(p) p.RatingId).Hidden("true") _
    }) _
    .ToolBar(Function(tBar) tBar.Create()) _
    .Editable(Function(edit) edit.Mode(GridEditMode.PopUp)) _
    .Scrollable(Function(scr) scr.Height(300)) _
    .Pageable(Function(page) page.PageSizes(True).Enabled(True).Refresh(True)) _
    .Sortable(Function(sort) sort.AllowUnsort(True).SortMode(GridSortMode.MultipleColumn).Enabled(True)) _
    .Selectable(Function(selectable) selectable.Mode(GridSelectionMode.Single).Enabled(True)) _
    .Resizable(Function(resize) resize.Columns(True)) _
    .Reorderable(Function(reorder) reorder.Columns(True)) _
    .EnableCustomBinding(True) _
    .ClientDetailTemplateId("DataDetails") _
    .Events(Function(e)
                    e.DetailCollapse("DetailCollapse")
                    e.DetailExpand("DetailExpand")
            End Function) _
    .DataSource(Function(dataSource) dataSource _
        .Ajax() _
        .Model(Sub(dataModel)
                       dataModel.Id(Function(p) p.Id)
               End Sub) _
        .Read(Function(read) read.Action("JsonData", "Home").Type(HttpVerbs.Post)) _
        .Create(Function(create) create.Action("Create", "Home")) _
    )

2 Answers, 1 is accepted

Sort by
0
Frederic
Top achievements
Rank 1
answered on 27 Feb 2013, 01:50 PM
Someone can help me ?
Any hint will be really appreciated.
Thanks.
0
Accepted
Iliana Dyankova
Telerik team
answered on 04 Mar 2013, 11:33 AM
Hello Frederic,

I am afraid what you would like to achieve is not supported out of the box in Kendo UI Grid for ASP.NET MVC. As a possible workaround I can suggest hooking to the Grid's edit event and changing the text via JavaScript. For example:
//....
.Events(ev => ev.Edit("onEdit"))
//....
 
<script>  
function onEdit() {
   updateBtnText = $(".k-grid-update").html().replace("Update", "CustomUpdateText");
   $(".k-grid-update").html(updateBtnText);
 
   cancelBtnText = $(".k-grid-cancel").html().replace("Cancel", "CustomCalcelText");
   $(".k-grid-cancel").html(cancelBtnText );  
}
</script>


Regards,
Iliana Nikolova
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
Grid
Asked by
Frederic
Top achievements
Rank 1
Answers by
Frederic
Top achievements
Rank 1
Iliana Dyankova
Telerik team
Share this question
or