BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
[Controller]
public ActionResult Index()
{
Dictionary<int, OrderTable> gridData = new Dictionary<int, OrderTable>();
int code = 1000;
for (var i =1; i < 11; i++)
{
gridData.Add(code+ 1, new OrderTable() { OrderID = code + i, CustomerID = "VINET", ShipCountry = "France", EmployeeID = i });
gridData.Add(code+2, new OrderTable() { OrderID = code + i, CustomerID = "TOMSP", ShipCountry = "Germany", EmployeeID = i });
gridData.Add(code+3, new OrderTable() { OrderID = code + i, CustomerID = "RONALD", ShipCountry = "Brazil", EmployeeID = i });
gridData.Add(code+4, new OrderTable() { OrderID = code + i, CustomerID = "KARIN", ShipCountry = "USA", EmployeeID = i });
gridData.Add(code+5, new OrderTable() { OrderID = code + i, CustomerID = "MARIO", ShipCountry = "Maxico", EmployeeID = i });
code += 5;
}
var data = gridData.Select(d => d.Value).ToList();
ViewBag.dataSource = data;
return View();
}
[Cshtml]
@Html.EJS().Grid("Grid").DataSource((IEnumerable<Object>)ViewBag.dataSource).Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").Width("150").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("CustomerID").HeaderText("Customer ID").Width("150").Add();
col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width("150").Add();
col.Field("ShipCountry").HeaderText("Ship Country").Width("150").Add();
}).AllowPaging(true).Render()
|