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

Broken editors in parent-child grid configuration

1 Answer 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ivailo
Top achievements
Rank 1
Ivailo asked on 17 Sep 2020, 12:54 PM
Hi guys,

I have a problem with editors in child grid. It seems that they cannot be initialized when clicking on them.
I've attached a video which is showing how are the grid cells behaving. I've isolated only 3 columns, but it is behaving like this for all columns even these with simple text.
Here is my grid configuration:

@(Html.Kendo()
               .Grid<DiscountViewModel>()
               .Name("resources")
               .HtmlAttributes(new { @class = "fullscreen-grid" })
               .AutoBind(false)
               .Columns(columns =>
               {
               columns.Bound(p => p.ResID)
                       .Title(R.ID)
                       .Width(70)
                       .Filterable(true);
 
               columns.Bound(p => p.ResPrice.UnitPriceUnit)
                   .Width(145)
                   .Title(R.UnitPriceUOM);
 
               columns.Bound(p => p.PriceEffectiveDate)
                   .EditorTemplateName("DatePrice")
                   .Format("{0:" + formatWithoutTime + "}")
                   .Width(150)
                   .Title(R.PriceEffective);
               })
               .Editable(editable => editable.Mode(GridEditMode.InCell).Enabled(!locked))
               .NoRecords()
               .Sortable()
               .Scrollable(s => s.Height("auto"))
               .Pageable(x =>
               {
                   x.Enabled(true);
                   x.PageSizes(defaultGridPageSizes);
                   x.PreviousNext(true);
                   x.Refresh(true);
               })
               .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
               .Resizable(resize => resize.Columns(true))
               .Reorderable(reorder => reorder.Columns(true))
               .DataSource(dataSource => dataSource
               .Ajax()
               .Batch(true)
               .ServerOperation(true)
               .PageSize(defaultGridPageSize)
                   .Model(model =>
                   {
                       model.Id(p => p.ResourceID);
                                
                   })
                   .Read(read => read.Action("Read", "RController").Data("filterPrice"))
                   .Update(x => x.Action("Update", "RController").Data("updateResourceFixDates"))
               )
               .ClientDetailTemplateId("resourceTemplate")
           )
 
           <script type="text/kendo" id="resourceTemplate">
               @(Html.Kendo().Grid<DiscountViewModel>()
                   .Name("res_#=PriceID#")
                   .HtmlAttributes(new { @class = "hiddenHeaderRow " })
                   .Columns(columns =>
                   {
                   columns.Bound(p => p.ResID)
                           .Title("ID")
                           .Width(60);
 
                   columns.Bound(p => p.ResPrice.UnitPriceUnit)
                           .Width(145)
                           .Title(R.UnitPriceUOM);
 
                                       
                   columns.Bound(p => p.PriceEffectiveDate)
                           .EditorTemplateName("DatePrice")
                           .Title(R.PriceEffective)
                           .Format("{0:" + formatWithoutTime + "}")
                           .Width(150);
                    })
                    .Editable(editable => editable.Mode(GridEditMode.InCell).Enabled(!locked))
                    .Sortable()
                    .Scrollable(scrollable => scrollable.Height(120))
                    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
                    .Resizable(resize => resize.Columns(true))
                    .Reorderable(reorder => reorder.Columns(true))
                    .DataSource(dataSource => dataSource
                    .Ajax()
                    .Batch(true)
                    .ServerOperation(true)
                    .Events(events => events.Error("error_handler"))
                    .Model(model =>
                    {
                        model.Id(p => p.ResourceID);
                    })
 
                    .Read(read => read.Action("Read", "RController", new {  }))
                    .Update(update => update.Action("Update", "RController").Data("updateResourceFixDates"))
                    ).ToClientTemplate()
               )
           </script>

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 21 Sep 2020, 05:54 AM

Hi Ivailo,

Based on the provided code snippets, I created a sample project with a date column that is being edited with the Kendo UI DatePicker. The correct editor is rendered for all cells of the child grid. Attached to my response, the sample could be found. 

The only option that I could think of causing the issue is if the PriceID has duplicate values and several grids with the same ID are rendered. 

Is it possible for you to check out the attached example and modify it in order to replicat the faulty behavior?

Thank you for your cooperation in advance.

 

Kind regards,
Tsvetomir
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Grid
Asked by
Ivailo
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or