asp.net-corekendo-uitelerik

A Kendo Template with DropDownList inside form layout generates invald template when setting ServerFiltering to True


When creating kendo ui Javascript template and using a form layout, adding a DropDownList with server filtering set to true, kendo ui will throw an "invalid template" error.

While setting the server filtering to false it will work as expected.

Sample code

https://github.com/Elrashid/TelerikAspNetCoreApp.tiket.2022121901

Compiled code

https://github.com/Elrashid/TelerikAspNetCoreApp.tiket.2022121901/releases/download/202211219194020/publish-self-contaned.zip

Tested Scenarios:

Error :

[enter image description here](https://i.stac> k.imgur.com/nULHE.png)

Error code :

<script type="text/x-kendo-template" id="dropDownList_inside_form_ServerFiltering_true_template">

    @(Html.Kendo().Form<TelerikAspNetCoreApp.tiket._2022121901.Controllers.Biblio>()
                .Name("Biblio_Form")
                .HtmlAttributes(new { action = "Biblio_Save", method = "POST", })
                .Layout("grid")
                .Grid(g => g.Cols(1).Gutter(10))
                .Validatable(v =>
                    {
                        v.ValidateOnBlur(true);
                        v.ValidationSummary(vs => vs.Enable(false));
                    })
                .Items(items =>
                {
                    items.Add()
                         .Field(f => f.BiblioId)
                         .Label(l => l.Text("Biblio Id"))
                         .Editor(e =>
                            {
                                e.DropDownList()
                                    .HtmlAttributes(new { })
                                    .DataTextField("Title")
                                    .DataValueField("BiblioId")
                                    .NoDataTemplate("nodata")
                                    .Filter(FilterType.Contains)
                                    .DataSource(source =>
                                            {
                                                source.Read(read =>
                                                {
                                                    read.Action("biblio_read", "Home");
                                                })
                                        .ServerFiltering(true);
                                            });
                            });
                }).ToClientTemplate())
</script>

Solution

  • Ref.

    [ASP.NET Core Data Grid Component Client Detail Templates - Telerik UI for ASP.NET Core] (https://docs.telerik.com/aspnet-core/html-helpers/data-management/grid/templates/client-detail-template)