This is a migrated thread and some comments may be shown as answers.

Multiples grids in one view

3 Answers 270 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Juan
Top achievements
Rank 1
Juan asked on 20 Nov 2016, 11:17 PM

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.

3 Answers, 1 is accepted

Sort by
0
Eduardo Serra
Telerik team
answered on 21 Nov 2016, 05:28 PM
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.
0
Juan
Top achievements
Rank 1
answered on 22 Nov 2016, 12:20 PM

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.

0
Kostadin
Telerik team
answered on 24 Nov 2016, 11:18 AM
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.
Tags
Grid
Asked by
Juan
Top achievements
Rank 1
Answers by
Eduardo Serra
Telerik team
Juan
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or