|
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
{
col.Field("EmployeeID").HeaderText("Employee Image").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Width("120").Add();
col.Field("OrderID").IsPrimaryKey(true).HeaderText("Order ID").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("CustomerID").HeaderText("Customer ID").Width("30%").Add();
col.Field("Freight").HeaderText("Freight").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width("120").Format("C2").Add();
col.Field("ShipCity").HeaderText("Ship Country").Width("120").Template("#template").Add();
}).Width("auto").Height("auto").AllowFiltering(true).Render()
<script id="template" type="text/x-template">
<a rel='nofollow' href="#">${ShipCity}</a>
</script>
<style>
.e-grid td.e-active {
background-color: yellow;
}
</style> |