Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
Unable to bind the data to grid
posted

//This is my code inside controller

 private empcontext db = new empcontext();

        //
        // GET: /Employee/
        [GridDataSourceAction]
        public ActionResult Index()
        {
            return View(db.Emps.ToList());
           
        }

//this is my view

 
    @(Html.Infragistics()
                        .Grid<databindingmvc4.Models.Employee>(Model)
                        .ID("grid")
                    .Width("100%")
                    .Height("500px")
                    .PrimaryKey("Id")
                    .AutoGenerateColumns(true)
                    .AutoGenerateLayouts(true)

        .Columns(column =>  
        {  
            column.For(x => x.Id).DataType("int").HeaderText("Id");  
            column.For(x => x.Name).DataType("string").HeaderText("Name");  
            column.For(x => x.Address).DataType("string").HeaderText("Address");  
           
        })
      
        .DataSourceUrl(Url.Action("Index"))  
      
        .DataBind()  
        .Render()  
    )

Thanks,

simpi
  

Parents
No Data
Reply
  • 49378
    Verified Answer
    posted

    Hello Simpi,

    Are there any clientside exceptions thrown in this case? Can you examine whether all of the grid resources are being successfully loaded? Also, does casting the passed model AsQueryable in the controller make a difference?

    A complete runnable sample demonstrating the scenario would be greatly appreciated.

    Do not hesitate to contact me with any updates regarding this matter.

Children