|
<system.web.webPages.razor>
<namespaces>
. . . .
<add namespace="Syncfusion.EJ2"/>
<add namespace="Syncfusion.JavaScript" />
<add namespace="Syncfusion.JavaScript.DataVisualization" />
<add namespace="Syncfusion.MVC.EJ" />
</namespaces>
</pages>
</system.web.webPages.razor> |
|
<html>
//Syncfusion Essential JS 2 Styles
<link rel="stylesheet" rel='nofollow' href="https://cdn.syncfusion.com/ej2/styles/compatibility/material.css" />
@* Syncfusion Essential JS 1 Styles *@
<link rel="stylesheet" rel='nofollow' href="https://cdn.syncfusion.com/16.1.0.24/js/web/flat-azure/ej.web.all.compatibility.min.css" />
@* Syncfusion Essential JS 1 Scripts *@
<script src="http://cdn.syncfusion.com/js/assets/external/jquery-3.0.0.min.js" type="text/javascript"></script>
<script src="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></script>
<script src="https://cdn.syncfusion.com/16.1.0.24/js/web/ej.web.all.min.js" type="text/javascript"></script>
@* Syncfusion Essential JS 2 Scripts *@
<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script>
. . . . . .
@Html.EJS().ScriptManager();
@Html.EJ().ScriptManager();
</html> |
|
@Html.EJS().Grid("FlatGrid").DataSource((IEnumerable<object>)ViewBag.dataSource).Width("auto")
.Height("359").Columns(col =>
{
col.HeaderText("Employee Image").Template("#template").Width("150").Add();
col.Field("EmployeeID").HeaderText("Employee ID").Width("120").Add();
col.Field("OrderID").HeaderText("Name").Width("125").Add();
}).Render()
<style>
a.grid-link {
color:blue;
}
a.grid-link-visited {
color: red;
}
</style>
<script id="template" type="text/x-template">
<a onClick="DownloadFile(this)" class="pointer-cursor grid-link">${EmployeeID}</a>
</script>
<script>
function DownloadFile(e) {
e.classList.remove("grid-link");
e.classList.add("grid-link-visited")
}
</script> |