@(Html.EJ().Grid<object>("Editing")
.Datasource(ds => { ds.URL("/odata/Employees").Adaptor(AdaptorType.ODataV4Adaptor); })
.PageSettings(page => page.PageSize(4))
.SelectedRowIndex(0)
.AllowPaging()
.Columns(col =>
{
col.Field("EmployeeID").HeaderText("Employee ID").Add(); //integer column
col.Field("TerritoryID").HeaderText("Territory ID").Add();
})
.ChildGrid(child =>
{
child.Datasource(da => da.URL("/odata/Orders").Adaptor(AdaptorType.ODataV4Adaptor))
.QueryString("EmployeeID") //passing integer column in QueryString
.AllowPaging()
.Columns(col =>
{
...
});
})
)
[EmployeesController.cs]
NORTHWNDEntities db = new NORTHWNDEntities();
[EnableQuery]
public IQueryable<EmployeeTerritory> Get()
{
return db.EmployeeTerritories;
}
|