Question

Let's say I have initialized a kendogrid like this.

$('#' + grids[i].gridName).kendoGrid({
    columns: [{
        width: 50, "template": "<input type=\"checkbox\" />"
    },
    {
        field: "Name",
        title: "Name"
    }]
}).css('width', '100%');

How can I add a databound function to the already existing kendoGrid?

The following does not work.

$("#grid").data("kendoGrid").dataBound = function(){
     //some code
}
Was it helpful?

Solution

Try this:

var grid = $("#grid").data("kendoGrid");
grid.bind("dataBound", function(e) {
    //your code here
});

OTHER TIPS

you may add databound function as below

$('#grid').data().kendoGrid.dataSource.bind('dataBound', function(e) { 
                 ...
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top