@using Syncfusion.EJ2
@model IEnumerable<TestData>
@using ViewModel
<div> <p style="font-weight: bold;">Table View </p></div>
@{
List<object> cols = new List<object>();
cols.Add(new { field = "OrderDate", direction = "Ascending" });
cols.Add(new { field = "Freight", direction = "Descending" });
}
@{
List<object> toolbarItems = new List<object>();
toolbarItems.Add(new { text = "Create", tooltipText = "Create", prefixIcon = "e-expand", id = "Create" });
toolbarItems.Add(new { text = "Search", tooltipText = "Search", prefixIcon = "e-expand", id = "Search" });
}
<div class="control-section">
@Html.EJS().Grid("GridView").DataSource((IEnumerable<object>)ViewBag.dataSource).Height("100%").Width("auto").AllowSorting().AllowMultiSorting(
).AllowFiltering(true).AllowPaging().AllowGrouping().AllowSelection().ToolbarClick("toolbarClick").FilterSettings(<lambda expression>).Columns(col =>
{
col.Field("DocumentStatus").HeaderText("Document Status").Type("string").Width("160").Add();
col.Field("DocumentNo").HeaderText("Document No").Type("string").Width("170").Add();
col.Field("DocumentType").HeaderText("Document Type").Type("string").Width("170").Add();
col.Field("DocumentOwner").HeaderText("Document Owner").Type("string").Width("170").Add();
col.Field("DocumentTitle").HeaderText("Document Title ").Type("string").Width("140").Add();
col.Field("Progression").HeaderText("Progression").Type("double").Width("140").Add();
col.Field("PlanStatus").HeaderText("Plan Status").Type("string").Width("170").Type("string").Add();
col.Field("DeploymentDate").HeaderText("Deployment Date").Width("170").Type("date").Format("dd/MM/yyyy").Add();
col.Field("Revision").HeaderText("Revision").Width("170").Type("string").Add();
col.Field("ProgressStage").HeaderText("Progress Stage").Width("170").Type("string").Add();
}).Toolbar(toolbarItems).PageSettings(page => page.PageCount(5)).Render()
</div>