Now I write the event three times:
I have 3 grid in a view page,I use databound .Events(events => events.DataBound("onDataBound") on each gird,Can I pass a parameter on the databound event.
function onDataBound(arg) {
alert(arg.sender.element[0].id);
}
Try this,
function onDataBound(arg) {
this.wrapper.attr('id');
}
Grid
@(Html.Kendo().Grid<TwoModelInSinglePageModel.SampleModel>()
.Name("grid12")
.Events(events => events.DataBound("onDataBound"))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.inx))
//.PageSize(1)
.Read(read => read.Action("Read", "Test"))
)
)
You can find id
of grid. Ex:My grid id="grid12"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With