@(Html.EJ().Grid<OrdersView>("ForeignKey")
.Datasource((IEnumerable<object>)ViewBag.dataSource1)
.AllowPaging()
.AllowGrouping()
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width(90).Add();
col.Field("EmployeeID").HeaderText("Employee Name").ForeignKeyField("EmployeeID")
.ForeignKeyValue("FirstName").DataSource((IEnumerable<object>)ViewBag.dataSource2)
.TextAlign(TextAlign.Left).Width(90).Add();
})
)
} |
@(Html.EJ().Grid<object>("FlatGrid")
.AllowSorting()
.Columns(col =>
{
. . .
col.Field("EmployeeID_FirstName").HeaderText("First Name")
.EditType(EditingType.Dropdown).DataSource((IEnumerable<object>)ViewBag.datasource2).DropDownEditOptions(new DropDownListProperties() { DropDownListFields = { Text = "FirstName", Value = "FirstName" } }).Width(90).Add();
})
)
|