hi,
I have used a grid with popup editing. I want to use only the destroy et create command of the grid. Its working fine but i want to change the text of that Update and Cancel button in the popup.
For override text, i find this solution but it dysplay the edit button and i don't want to dysplay this button and not define Update action.
command.Edit().UpdateText("Custom Text").CancelText("Custom Text");
@(Html.Kendo().Grid<Modele>().Name("Grid")
.ToolBar(toolbar => toolbar.Create())
.Columns(columns =>
{
columns.Bound(a => a.FirstName);
columns.Bound(a => a.LastName);
columns.Command(command =>
{
command.Edit().UpdateText("Custom Update").CancelText("Custom Cancel");
command.Destroy();
});
})
.Editable(editable => editable.Mode(GridEditMode.PopUp)
.Window(w => w.Resizable()))
.DataSource(dataSource => dataSource.Ajax().Batch(false)
.ServerOperation(false)
.Events(events => events.Error("error"))
.Model(model => model.Id(a => a.FirstName))
.Update(update => update.Action("FakeUpdate", "Controller"))
.Read(read => read.Action("Read", "Controller"))
.Create(read => read.Action("Create", "Controller"))
.Destroy(read => read.Action("Destroy", "Controller"))))
Thanks.
3 Answers, 1 is accepted
In order to achieve the desired outcome you could apply the solution you have found and hide the Edit button using CSS. For example:
@(Html.Kendo().Grid<Modele>().Name("Grid") .ToolBar(toolbar => toolbar.Create()) .Columns(columns => { //.... { command.Edit().UpdateText("Custom Update").CancelText("Custom Cancel"); command.Destroy(); }); }) //....)<style> .k-button.k-grid-edit { display: none; }</style>Regards,
Iliana Nikolovathe Telerik team
In that case you can subscribe to the Grid's edit event handler. Once the event is triggered you can find the button in the e.container argument and either hide it or change its text accordingly.
Regards,
Alexander Popov
Telerik