Grid - custom Create button, instead of toolbar.Create()

3 posts, 1 answers
  1. Edin
    Edin avatar
    2 posts
    Member since:
    Sep 2014

    Posted 27 Jul Link to this post

    Hello,

    I'm trying to trigger the Create operation using the custom button (created by using custom header template of the custom column, as shown on the screenshot) - in order to avoid use of the grid toolbar. Is there a way to bind the Create operation to the custom control, on the grid?

    Regards

  2. Answer
    Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 29 Jul Link to this post

    Hello Edin,

    In order to add a new row to the grid you can use addRow method. Generally you need to call a javascript function and get the grid object.

    Regards,
    Kostadin
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Edin
    Edin avatar
    2 posts
    Member since:
    Sep 2014

    Posted 29 Jul in reply to Kostadin Link to this post

    Works perfectly - thank you!

    columns.Template(@<text></text>).HeaderTemplate("<span class='addGridRecordBtn' onclick='addGridRecordBtnClick()' style='cursor:pointer;'><i class='fa fa-plus'></i></span>").Width(10)

    function addGridRecordBtnClick() {
         var grid = $("#GridTradeGroup").data("kendoGrid");
         grid.addRow();
    }

    Regards

Back to Top