Item Command for checked item on Kendo Grid with Custom button

4 posts, 1 answers
  1. Ryan
    Ryan avatar
    91 posts
    Member since:
    Aug 2012

    Posted 01 Dec 2019 Link to this post

    Hi All,

    Just wondering where to find sample to invoke item command for checked item on my kendo grid using my custom button?

    Also how to show that row is selected when I check the checkbox?

    Lastly how to unchecked my header template checkbox when I change page?

    columns.Bound(column => column.ProfileID)
    .ClientTemplate("<input class='box' type='checkbox' value='#=ProfileID#' />")
    .ClientHeaderTemplate("<input type='checkbox' id='selectAll' onclick='toggleSelection()' />")
    .Width(40)
    .Sortable(false)
    .Filterable(false);

    Thanks in Advance

    Ryan

  2. Ryan
    Ryan avatar
    91 posts
    Member since:
    Aug 2012

    Posted 02 Dec 2019 in reply to Ryan Link to this post

    Last 2 questions already managed to make it work.

    Just the 1st question regarding sample to invoke item command (popup edit/delete) on checked item on Kendo Grid.

    Thanks!

    Ryan

  3. Answer
    Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1081 posts

    Posted 03 Dec 2019 Link to this post

    Hello, Ryan,

    The Kendo UI Grid for ASP.NET MVC offers the checkbox selection functionality out of the box by just adding a selectable column to the configuration as demonstrated in this online demo:

    https://demos.telerik.com/aspnet-mvc/grid/checkbox-selection

    Whether you decide to use the built-in checkbox selection or not, you can add a click handler to the grid tbody and get the currently selected row and use the grid client-side method editRow() to open the row for editing:

    https://dojo.telerik.com/@bubblemaster/ayAhASUQ/2

     $("#grid tbody").on("click", ".k-checkbox-label", function(e){
         var grid = $("#grid").data("kendoGrid");
         var selectedRow = $(e.target).closest("tr");
         grid.editRow(selectedRow);
    });

    Let me know in case you have further questions.

    Kind Regards,
    Alex Hajigeorgieva
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  4. Ryan
    Ryan avatar
    91 posts
    Member since:
    Aug 2012

    Posted 06 Dec 2019 in reply to Alex Hajigeorgieva Link to this post

    Thanks Alex Hajigeorgieva, it work like a charm!
Back to Top