cant find editortemplatesource for asp.net core grid basic usage

1 Answer 17 Views
ComboBox DropDownList Editor Grid
Caleb
Top achievements
Rank 1
Caleb asked on 13 Dec 2021, 07:47 PM

Per:
https://demos.telerik.com/aspnet-core/grid
can someone provide/post the source for the Editor Templates Names for Country and ClientCategoryEditor?

I'm trying to make an editable  grid with a select control in one of the columns (Country), just like the demo...  but the source code/markup  seems to be incomplete...
I'm looking for the source editor templates behind these:

 columns.Bound(p => p.Country.CountryNameLong).Title("Country").EditorTemplateName("Country")

 columns.Bound(=> p.Category.CategoryName).EditorTemplateName("ClientCategoryEditor")

fyi these are broken in  the edit in teletik repl as well....

maybe if it was a snake it would have bit me...

Thanks

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 16 Dec 2021, 09:55 AM

Hello Caleb,

The editors for the Category and Country follow the guideline on creating Custom Editors for the Grid columns documented here:

That said, here are the custom editors used for the Grid Overview demo:

ClientCategoryEditor:

@model Kendo.Mvc.Examples.Models.CategoryViewModel

@(Html.Kendo().DropDownListFor(m => m)
            .DataValueField("CategoryID")
            .DataTextField("CategoryName")
            .HtmlAttributes(new {data_bind="value: Category" })
            .BindTo((System.Collections.IEnumerable)ViewData["categories"])
)

Country:

@model Kendo.Mvc.Examples.Models.CountryViewModel

@(Html.Kendo().DropDownListFor(m => m)
            .DataValueField("CountryNameShort")
            .DataTextField("CountryNameLong")
            .HtmlAttributes(new { data_bind = "value: Country" })
            .Template(@"<div class='dropdown-country-wrap'><img src='" + @Url.Content("~/shared/web/country-flags/#:data.CountryNameShort#.png") + "' alt='#: data.CountryNameLong#' title='#: data.CountryNameLong#' width='20' /><span>#: data.CountryNameLong #</span></div>")
            .BindTo((System.Collections.IEnumerable)ViewData["countries"])
            .AutoWidth(true)
)

Regards,
Aleksandar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
ComboBox DropDownList Editor Grid
Asked by
Caleb
Top achievements
Rank 1
Answers by
Aleksandar
Telerik team
Share this question
or