Kendo Grid MVC beforeEdit

2 posts, 0 answers
  1. Thomas
    Thomas avatar
    8 posts
    Member since:
    Jun 2015

    Posted 10 Aug 2017 Link to this post

    Hello,

    The only way we can access the beforeEdit Event on a kendo grid is with javascript. shouldnt this be accessible through the Kendo.Mvc.UI.Fluent.GridEventBuilder? attached are just images showing that it errors and that we are using Kendo version 2017.2.621.340 as our dll.

     

    the way we did get it to work is by binding it via javascript with this code (for anyone that wants to know how to get this event to work)

        $(document).ready(function () {
            var grid = $("#BrandsGrid").data("kendoGrid");
          
            grid.bind("beforeEdit", function (e) {
                alert("Before Edit");
            });

        })

    but its weird to have 2 of your events using the grid builder and then 1 of your events bound through javascript makes it easy for a developer to miss that the event exists which can lead to them not fully understanding what is happening upon editing the grid.

     

    Thanks,

    Thomas

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2501 posts

    Posted 14 Aug 2017 Link to this post

    Hello Thomas,

    This is a known issue and the developers have included a fix for it. It will be available in the next official release. 

    Until the new release is available you can use the JavaScript syntax to add handler for the beforeEdit event:


    $(function () {
        var grid = $("#grid").getKendoGrid();
        grid.bind("beforeEdit", beforeEditHandler);
     
        function beforeEditHandler(e) {
            alert("before edit");
        }
    })


    Regards,
    Viktor Tachev
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top