get kendo child grid value

1 Answer 14 Views
Grid
Blessy
Top achievements
Rank 1
Blessy asked on 29 May 2024, 03:09 PM | edited on 29 May 2024, 03:10 PM
I want to set child grid value as html attribute. I tried like this \\#=ImportName_InlowerCase\\#. this is not working in asp.net core CShtml files. Please help me to resolve this. 

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 31 May 2024, 02:40 PM

Hello Blessy,

As a result of the CSP compliance initiative, we had to remove all Kendo UI templates from the source of the Telerik UI for ASP.NET Core components. 

With that said, you can use the new HtmlAttributes() overload that accepts a single string parameter (a name of a JavaScript function) to return the desired attributes:

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()
            .Name("grid_#=EmployeeID#")
            .Columns(columns =>
            {
                columns.Bound(o => o.OrderID).HtmlAttributes("customAttributes");
                ...
            })
            ...
)

<script>
  function customAttributes(data) {
    return { id: `${data.OrderID}`, title: `${data.OrderID}` };
  }
</script>

Here is a REPL sample that showcases this example:

https://netcorerepl.telerik.com/woafxlvo34z0b4FH58

I hope that helps.

 

Regards,
Mihaela
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Tags
Grid
Asked by
Blessy
Top achievements
Rank 1
Answers by
Mihaela
Telerik team
Share this question
or