This question is locked. New answers and comments are not allowed.
Using the Grid with Ajax binding and the Entity Framework and specifying only the select method and action in the controller and view, the grid displays with the "No records to display message" even though the ajax bind method is called in the controller and the object that is created and assgined as the ajax method output is of the correct type.
I have a view with three grids, two of which are embedded in a tab strip.
Here is my view:
@{ ViewBag.Title = "JobDetails"; } <h2>JobDetails</h2> @{ Html.Telerik().Grid<DSAdmin.PROCESS_EXECUTION>() //Grid((IEnumerable<DSAdmin.PROCESS_EXECUTION>)ViewData["Instances"]) .Name("ExecutionInstances") .DataBinding(dataBinding => dataBinding .Ajax() .Select("_Select_ExecutionInstance", "JobDetails", new { execID = ViewData["execID"] })) //, environment = ViewData["Environment"], mode = mode, type = type, pageInput = ViewData["pageInput"], nextPrevious = ViewData["nextPrevious"], numeric = ViewData["numeric"], position = position, currentPage = (int)ViewData["currentPage"], pageSize = ViewData["pageSize"] })) .Columns(columns => { columns.Bound(o => o.EXECUTION_ID).Title("Execution ID").Width(100).ReadOnly(true); columns.Bound(o => o.PROCESS_OBJECT.OBJECT_NAME).Title("Process Name").Width(200).ReadOnly(true); columns.Bound(o => o.STATUS).Title("Status").Width(125); columns.Bound(o => o.START_TIME).Title("Start Time").Width(150).ReadOnly(true); columns.Bound(o => o.END_TIME).Title("End Time").ReadOnly(true); }) .Render(); <p style="border:2px solid limegreen"> </p> Html.Telerik().TabStrip() .Name("details_tab") .Items(ts => { ts.Add() .Text("ETL Control") .Content(@<text> @{Html.Telerik().Grid<DSAdmin.ETL_CONTROL_TABLE>() //.Grid((IEnumerable<DSAdmin.ETL_CONTROL_TABLE>)ViewData["ETL_Control"]) .Name("ETL_Control") .DataBinding(dataBinding => dataBinding .Ajax() .Select("_Select_JobDetails", "JobDetails", new { execID = ViewData["execID"]})) //, environment = ViewData["Environment"], mode = mode, type = type, pageInput = ViewData["pageInput"], nextPrevious = ViewData["nextPrevious"], numeric = ViewData["numeric"], position = position, currentPage = (int)ViewData["currentPage"], pageSize = ViewData["pageSize"] })) .Columns(columns => { columns.Bound(o => o.JOB_EXECUTION_ID).Title("Execution ID").Width(100).ReadOnly(true); columns.Bound(o => o.PROCESS_NAME).Title("Process Name").Width(200).ReadOnly(true); columns.Bound(o => o.STATUS).Title("Status").Width(125); columns.Bound(o => o.START_TIME).Title("Start Time").Width(150).ReadOnly(true); columns.Bound(o => o.END_TIME).Title("End Time").ReadOnly(true); }) .Render(); } </text> ); ts.Add() .Text("Messages") .Content(@<text> @{Html.Telerik().Grid<DSAdmin.PROCESS_MESSAGE>() //.Grid((IEnumerable<DSAdmin.PROCESS_MESSAGE>)ViewData["Process_Message"]) .Name("Messages") .DataBinding(dataBinding => dataBinding .Ajax() .Select("_Select_Messages", "JobDetails", new { execID = ViewData["execID"] })) //, environment = ViewData["Environment"],mode = mode, type = type, pageInput = ViewData["pageInput"], nextPrevious = ViewData["nextPrevious"], numeric = ViewData["numeric"], position = position, currentPage = (int)ViewData["currentPage"], pageSize = ViewData["pageSize"] })) .Columns(columns => { columns.Bound(o => o.MESSAGE_SEQUENCE_ID).Title("Execution ID").Width(100).ReadOnly(true); columns.Bound(o => o.MESSAGE_TEXT).Title("Message").Width(850).ReadOnly(true); columns.Bound(o => o.MESSAGE_TYPE_ID).Title("Type").ReadOnly(true); }) .Render(); } </text> ); }) .SelectedIndex(0) .Render(); } <script type="text/javascript"> </script>Here is my controller:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using DSAdmin; using Telerik.Web.Mvc; using Telerik.Web.Mvc.UI; using System.Web.Routing; using Telerik.Web.Mvc.Extensions; using System.Diagnostics; namespace DSAdmin.Controllers { public class JobDetailsController : Controller { private BODS_ETL_CONTROLEntities db; private void SetConnection(String connection) { db = new BODS_ETL_CONTROLEntities(ConnectionHelper.GetConnectionString(connection)); } public ActionResult JobDetails(int? execID) { return View(); } [GridAction] public ActionResult _Select_ExecutionInstance(int? execID) { SetConnection("Sandbox"); var pe = db.PROCESS_EXECUTION.Where(e => e.JOB_ID == 13); return View(new GridModel(pe)); } [GridAction] public ActionResult _Select_JobDetails(int? execID) { SetConnection("Sandbox"); var etl = db.ETL_CONTROL_TABLE.Where(e => e.JOB_ID == 13); return View(new GridModel(etl)); } [GridAction] public ActionResult _Select_Messages(int? execID) { SetConnection("Sandbox"); var pm = db.PROCESS_MESSAGE.Where(e => e.PROCESS_OBJECT.OBJECT_ID == 44); return View(new GridModel(pm)); } } } I have looked at the online examples and I do not see any difference. I also attahced a screen shot.
Thanks,
Carey