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

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

2 Answers 1880 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Edin
Top achievements
Rank 2
Edin asked on 27 Jul 2016, 07:21 AM

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 Answers, 1 is accepted

Sort by
0
Accepted
Kostadin
Telerik team
answered on 29 Jul 2016, 05:59 AM
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
0
Edin
Top achievements
Rank 2
answered on 29 Jul 2016, 07:10 AM

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

Tags
Grid
Asked by
Edin
Top achievements
Rank 2
Answers by
Kostadin
Telerik team
Edin
Top achievements
Rank 2
Share this question
or