Reputation: 1730
How can I have multiple functions for DataBound in Kendo Grid MVC
events.DataBound().Events(events => events.DataBound("AdvancedGrid.onDataBound", "alertMe"));
so it will trig both function.
Upvotes: 2
Views: 7650
Reputation: 307
Try this. It works fine for me.
.Events(ev=>{ev.DataBound(@<text>function(e){ onDataBound(e); alertMe(); }</text>); })
Upvotes: 1
Reputation: 1730
Through HtmlHelper you can't add more function to event so I look in DOM object found grid and saw that _events -> dataBound is array, so I added run this
var grid = $("#MyGrid").data("kendoGrid");
grid.bind("dataBound", alertMe);
grid.dataSource.fetch();
and now my dataBound has 2 events
Upvotes: 2