This question is locked. New answers and comments are not allowed.
I am certain I am missing something but here goes. I create separate projects for the Model, BLL, and DAL. I created a controller with code
I then created a view off the Index with code
The problem I am having is that in the controller the ViewData does get populated correctly it is confirmed the object is being filled and passed to the viewdata object under my chosen key. Once you visit the page which contains the grid control states there is no data. The two columns show the correct names as expected but it states there is no data. Please help.
Thanks for the reply.
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using IMRS.Model;using IMRS.BLL;using Telerik.Web.Mvc;using Telerik.Web.Mvc.UI;namespace IMRS.Controllers{ [HandleError] public class JobCodesController : Controller { // // GET: /JobCodes/ [GridAction] public ActionResult Index() { JobCodesBLL jobCodesBLL = new JobCodesBLL(); //JobCode jobCode = jobCodesBLL.GetJobCodeById(1); ViewData["jobCode"] = jobCodesBLL.GetJobCodeById(1); return View(); }}I then created a view off the Index with code
@using IMRS.Model@using Telerik.Web.Mvc.UI@{ ViewBag.Title = "View All Job Codes";}<h2>Index</h2>@( Html.Telerik().Grid<IMRS.Model.JobCode>("jobCode").Name("AllJobCodes") .DataKeys(k => k.Add(o => o.ID)) .Columns(c => { c.Bound(o => o.JobCodeNumber).ReadOnly(); c.Bound(o => o.Description).ReadOnly(); }) .DataBinding(b => b.Server()))The problem I am having is that in the controller the ViewData does get populated correctly it is confirmed the object is being filled and passed to the viewdata object under my chosen key. Once you visit the page which contains the grid control states there is no data. The two columns show the correct names as expected but it states there is no data. Please help.
Thanks for the reply.