Unexpected Behavior - rendering 2 grids

6 posts, 0 answers
  1. figueiredorj
    figueiredorj avatar
    68 posts
    Member since:
    Mar 2011

    Posted 11 Jun 2012 Link to this post

    Hi.
    I have been testing MVC Kendo.

    Testing Grid has an unexpected behavior (see attached image grid_twice.png).

    That render is result of the following code:
    view:
    @model IEnumerable<_2TrackControl.MVC4.Models._2TrackControl.KitViewModel>
    @using Kendo.Mvc.UI
    @{
        ViewBag.Title = "Index";
    }
    <h2>
        Index</h2>
    <p>
        @Html.ActionLink("Create New", "Create")
    </p>
    @(Html.Kendo().Grid(Model)   
        .Name("Grid")
        .Columns(columns =>
        {
            columns.Bound(p => p.ClientSetName).Groupable(false);
            columns.Bound(p => p.IMEI);
            columns.Bound(p => p.Active);
            columns.Bound(p => p.Inserted);
        })
        .Groupable()
        .Pageable()
        .Sortable()
        .Scrollable()
        .Filterable()            
        .DataSource(dataSource => dataSource
             
            .Ajax()
            .Read(read => read.Action("_Index", "Kit"))       
        )
    )
    and actions:

    private Entities db = new Entities();
      
    //
    // GET: /Kit/
      
    public ActionResult Index()
    {
        var kitset = db.KitSet.Include("ClientSet");
      
        Mapper.CreateMap<KitSet, KitViewModel>();
        var resultReturn = Mapper.Map<List<KitSet>, List<KitViewModel>>(kitset.ToList());
      
        return View(resultReturn);
    }
      
    public ActionResult _Index([DataSourceRequest] DataSourceRequest request)
    {
        var kitset = db.KitSet.Include("ClientSet");
      
        Mapper.CreateMap<KitSet, KitViewModel>();
        var resultReturn = Mapper.Map<List<KitSet>, List<KitViewModel>>(kitset.ToList());
        return Json(resultReturn.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
    }

    Can you figure what is happening?
    Thanks
  2. Rosen
    Admin
    Rosen avatar
    3237 posts

    Posted 12 Jun 2012 Link to this post

    Hello,

    Unfortunately, the provided information is insufficient in order to track the cause for such behavior. Therefore, please provide a small runnable project which demonstrates the described issue.

    All the best,
    Rosen
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Ricardo
    Ricardo avatar
    1 posts
    Member since:
    Jun 2012

    Posted 12 Jun 2012 Link to this post

    Hi.
    I have clean up scripts and styles of kendo in order to accomplish size upload.I left dll.
    Although this is a mvc4 proj mvc3 do the same as I have tested in my original project.

    Thanks for helping out.
  5. Rosen
    Admin
    Rosen avatar
    3237 posts

    Posted 13 Jun 2012 Link to this post

    Hello Ricardo,

    Although, I'm unable to recreate the behavior you have described (refer to the attached screenshot), the page you have provided is not valid html document. There is no html, head nor body tags, as well as doc type.

    Regards,
    Rosen
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. figueiredorj
    figueiredorj avatar
    68 posts
    Member since:
    Mar 2011

    Posted 13 Jun 2012 Link to this post

    Hi.
    I tried to attach full project with no success.
    Can I send it to you by mail? 
    Compresses it has about 8.5 MB (nuget packages for mvc4)

    Thanks.
  7. figueiredorj
    figueiredorj avatar
    68 posts
    Member since:
    Mar 2011

    Posted 13 Jun 2012 Link to this post

    I figure it out.
    I was missing kendo.aspnetmvc.js. More precisely i only had on my folder minified version but was trying to use standard as in demo.

    Thanks for your help.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready