Public Class ContractsController
Inherits System.Web.Mvc.Controller
Private db As New TrackingEntities
' GET: Contracts
Function Index() As ActionResult
Dim contracts = db.Contracts.Include(Function(c) c.Customer)
Return View(contracts.ToList())
End Function
@Html.EJS().Grid("LocalData").DataSource(Model).Render()
|
@Imports Syncfusion.EJ2
<!DOCTYPE html>
<html>
<head>
...
<!-- Syncfusion Essential JS 2 Styles -->
<!-- Syncfusion Essential JS 2 Scripts -->
</head>
<body>
...
@Html.EJS().ScriptManager()
</body>
</html>
|
|
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
...
<add namespace="VBSample" />
<add namespace="Syncfusion.EJ2" />
</namespaces>
</pages> |
|
[Index.vbhtml]
@Imports Syncfusion.EJ2
@Html.EJS().Grid("Grid").DataSource(Model).AllowPaging().Render()
[HomeController.vb]
Function Index() As ActionResult
BindDataSource()
Dim contracts = order
Return View(contracts.ToList())
End Function
|
|
[Index.vbhtml]
@Imports Syncfusion.EJ2
@Html.EJS().Grid("Grid").DataSource(Model).AllowPaging()
.Columns(Sub(col)
col.Field("OrderID").HeaderText("Order ID").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width("120").Add()
col.Field("CustomerID").HeaderText("Customer Name").Width("150").Add()
col.Field("Freight").HeaderText("Freight").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width("120").Format("C2").Add()
End Sub).Render()
|