Grid / Editing custom editor example question

2 posts, 0 answers
  1. AndyP
    AndyP avatar
    1 posts
    Member since:
    Nov 2016

    Posted 02 Mar 2017 Link to this post

    This examples mentions "Html.Kendo().DropDownListFor()" but the actual razor markup does not use this helper. Can someone show how to correctly use the drop down within the grid in MVC ?
  2. Dimiter Topalov
    Dimiter Topalov avatar
    1298 posts

    Posted 03 Mar 2017 Link to this post

    Hi AndyP,

    The Html.Kendo().DropDownListFor() helper can be found in the ClientCategory.cshtml file, in the EditorTemplates folder.

    The described custom editor functionality is achieved by following the steps in the following article from our documentation:

    The demo, and all associated files (View, Controllers, EditorTemplates, and class definitions) are also available in the sample application, coming with your installation package:

    Alternatively, you can use the following syntax:

    // Grid configuration in the .cshtml file
    columns.Bound(p => p.Category).ClientTemplate("#=Category.CategoryName#").EditorTemplateName("ClientCategory").Width(180);

    // ClientCategory.cshtml in the EditorTemplates folder
    @model Kendo.Mvc.Examples.Models.CategoryViewModel
    @(Html.Kendo().DropDownListFor(m => m)

    I hope this helps.

    Dimiter Topalov
    Telerik by Progress
    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.
Back to Top