This is a migrated thread and some comments may be shown as answers.
Unexpected Behavior - rendering 2 grids
5 Answers 52 Views
This is a migrated thread and some comments may be shown as answers.
figueiredorj
Top achievements
Rank 1
figueiredorj asked on 11 Jun 2012, 03:12 PM
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

5 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 12 Jun 2012, 01:11 PM
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!
0
Ricardo
Top achievements
Rank 1
answered on 12 Jun 2012, 03:37 PM
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.
0
Rosen
Telerik team
answered on 13 Jun 2012, 06:38 AM
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!
0
figueiredorj
Top achievements
Rank 1
answered on 13 Jun 2012, 07:06 AM
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.
0
figueiredorj
Top achievements
Rank 1
answered on 13 Jun 2012, 08:56 AM
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.
Tags
Grid
Asked by
figueiredorj
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Ricardo
Top achievements
Rank 1
figueiredorj
Top achievements
Rank 1
Share this question
or