Multiples grids in one view

4 posts, 0 answers
  1. Juan
    Juan avatar
    24 posts
    Member since:
    Oct 2016

    Posted 20 Nov 2016 Link to this post

    I have an issue when i tried to show more than one grid in the view.

    This is my first grid that works fine.

    @model IEnumerable<CampeonatoFutbol.Models.PartidoClub>

     @(Html.Kendo().Grid(Model)
            .Name("grid")
            .Columns(columns =>
            {
                columns.Bound(c => c.ClubDesc).Title("EQUIPO").Width(220);
                columns.Bound(c => c.PrtidoCodigo).Title("PJ").Width(60);
                columns.Bound(c => c.GolesClub).Title("GC").Width(60);
                columns.Bound(c => c.PuntosClub).Title("PUNTOS").Width(150);
            })
            .HtmlAttributes(new { style = "height: 300px;" })
            .Scrollable()
            .Reorderable(reorder => reorder.Columns(true))
            .Pageable(pageable => pageable
                .PageSizes(true))
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(20)
            )
    )

    And this the method action of the controller that render the html of that grid.

    public ActionResult Campeonato()
    {

         //return a list for the grid

    }

     

    and whe i tried to put another grid in the same view, the second grid doesn´t show me anything

    This is the second grid that i tried to use:

     @(Html.Kendo().Grid<CampeonatoFutbol.Models.PartidoClub>()
                        .Name("gridGoleadores")
                        .Columns(columns =>
                        {
                            columns.Bound(c => c.NombreJugador).Title("JUGADOR").Width(220);
                            columns.Bound(c => c.ClubDesc).Title("EQUIPO").Width(60);
                            columns.Bound(c => c.GolesJugador).Title("GOLES").Width(60);
                        })
                        .HtmlAttributes(new { style = "height: 300px;" })
                        .Scrollable()
                        .Reorderable(reorder => reorder.Columns(true))
                        .Pageable(pageable => pageable
                        .PageSizes(true))
                        .DataSource(dataSource => dataSource
                        .Ajax()
                        .Read(read => read.Action("GoleadoresCampeonato", "Campeonato"))
                        .PageSize(20)
                        )
                    )

    And this is the method action that it's never called:

     public ActionResult GoleadoresCampeonato([DataSourceRequest]DataSourceRequest request)
    {

        return Json(list.ToDataSourceResult(request) ) 

    }

     

    I hope someone can helpme whit this.

  2. Eduardo Serra
    Admin
    Eduardo Serra avatar
    119 posts

    Posted 21 Nov 2016 Link to this post

    Hello Juan,

    From the code that was shared, it is difficult to determine what might be going on in this particular case; if you were able to provide us with an isolated runnable sample that reproduces the issue we could run and debug the project to find what's causing this to happen.

    I hope this helps.

    Regards,
    Eduardo Serra
    Telerik by Progress
    Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
  3. Juan
    Juan avatar
    24 posts
    Member since:
    Oct 2016

    Posted 22 Nov 2016 in reply to Eduardo Serra Link to this post

    Thanks for the reply,but i don't understand very well how to make " isolated runnable sample that reproduces the issue".

    i hope you help me with this issue that i have.

  4. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 24 Nov 2016 Link to this post

    Hello Juan,

    You can send a sample project with two grid bound to a dummy database where the issue that you are facing could be observed. Note that we are not able to reproduce the issue on our side by adding two grids on a single page. Additionally you can check for any client side exception which might help us find the root cause of this issue.

    Regards,
    Kostadin
    Telerik by Progress
    Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
Back to Top