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

Kendo Grid Detail Template Grid Not Binding (after first row)

2 Answers 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
BR Developer
Top achievements
Rank 1
BR Developer asked on 10 Aug 2017, 07:56 PM

The detail template grid is not binding the data properly. If I expand one by one from top to bottom, it only binds the data for the first row and the grid inside all other rows are empty. If I expand them from bottom to top, it binds the data properly for all the rows. Any idea why it's doing this?

@(Html.Kendo().Grid<EmailInvitationViewModel>()
                            .Name("EmailInviteeGrid")
                            .Columns(columns =>
                            {
                                columns.Bound(e => e.EmailInviteID).Hidden(true);
                                columns.Bound(e => e.InvitationDate).Title("Invited On").Hidden(false);
                                columns.Bound(e => e.ClassDetails).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains"))).Title("Class Details");
                            })
                            .Sortable()
                            .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
                            .Pageable(pageable => pageable
                              .Refresh(true)
                              .PageSizes(true)
                              .ButtonCount(5))
                            .ClientDetailTemplateId("template")
                            .DataSource(dataSource => dataSource
                                .Ajax()
                                .PageSize(10)
                                .Read(read => read.Action("GetAllInvitedEvents", "Controller", new { Model.EventID }))
                            ))
                        )
    <script id="template" type="text/kendo-tmpl">
        @(Html.Kendo().Grid<EmailInvitationViewModel>()
        .Name("grid_#=EmailInviteID#") 
        .Columns(columns =>
        {
            columns.Bound(o => o.GridInviteeEmail);
        })
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(10)
        .Read(read => read.Action("GetAllInviteeEmailsByEvent", "DataSource", new { EventID = "#=EventID#", EmailInviteID = "#=EmailInviteID#" }))
        )
        .Pageable()
        .Sortable()
        .ToClientTemplate()
                        )
    </script>

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 14 Aug 2017, 12:02 PM
Hello Team,

The provided configuration looks good.

Based on it I can assume that values different than the expected ones are passed to the GetAllInviteeEmailsByEvent action.

I can suggest inspecting if the correct values are received in the Controller action, and then if the Controller is returning the expected values based on the expanded row.

If all values are as expected, please provide a fully runnable example as the issue may be caused by a custom factor which we are overlooking at this moment.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Jay
Top achievements
Rank 1
commented on 23 Jun 2021, 06:11 PM

Even I have the same issue. It was used to work fine and after taking new kendo version and Jquery upgrade it stop working. Is still working fine with my other branch with older kendo version. Is there any thing change in the new kendo approach ? example, i have 3 different id records in the child but after going inside kendo function all 3 times its duplicating same id.
Anton Mironov
Telerik team
commented on 25 Jun 2021, 10:54 AM

Hi Jay,

I have answered your inquiry in support ticket #1525217.

I am currently trying to replicate the pointed faulty behavior. Here is a dojo example with the pointed versions(Kendo UI 2021.2.511 and jQuery 3.5.1):

https://dojo.telerik.com/@anton.mironov/AvOkojUJ

The fastest route to getting you up and running is if you could provide a runnable, isolated, sample project. Examining this project will let us replicate the issue locally and further troubleshoot it.

Looking forward to hearing back from you. Once I have a runnable sample locally, I will debug and try my best to resolve this one and send it back in this thread.

 

Kind Regards,
Anton Mironov
Progress Telerik
0
BR Developer
Top achievements
Rank 1
answered on 15 Aug 2017, 03:55 PM
Got it to work! The name of the sub-grid had to be unique for each master row.
Tags
Grid
Asked by
BR Developer
Top achievements
Rank 1
Answers by
Stefan
Telerik team
BR Developer
Top achievements
Rank 1
Share this question
or