Andrian Durlestean
Andrian Durlestean

Reputation: 1730

MVC Kendo Grid multiple functions for DataBound event

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

Answers (2)

giparekh
giparekh

Reputation: 307

Try this. It works fine for me.

.Events(ev=>{ev.DataBound(@<text>function(e){ onDataBound(e); alertMe(); }</text>); })

Upvotes: 1

Andrian Durlestean
Andrian Durlestean

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

enter image description here

Upvotes: 2

Related Questions