Hi Carlos,
Thanks for contacting Syncfusion support.
We have validated your requirement. We have create a sample for your reference. In the below sample we have to print the grid by using external button. Kindly please refer the below sample and code snippet for more information.
<div>
@Html.EJS().Button("printbtn").Content("Print").IsPrimary(true).Render() // render button
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
{
col.Field("ShipName").HeaderText("Ship Name").Width("150").Add();
col.Field("ShipCountry").HeaderText("Ship Country").Width("150"). Add();
}).Render()
</div>
<script>
document.getElementById('printbtn').onclick = function () {
document.getElementById('Grid').ej2_instances[0].print() // use print() method to print the Grid
}
</script> |
Regards,
R.Dhivya