How to set EditorTemplatName for Auto Generated columns?

2 posts, 0 answers
  1. Ryan
    Ryan avatar
    11 posts
    Member since:
    Oct 2017

    Posted 21 Nov 2017 Link to this post


    I am using a DataTable to automatically generate grid columns as in the "binding-to-datatable" example.  This is working well, but I can't figure out how to create a dropdown list for a given known column. 


    Prior to autogenerating the columns, I would use "EditorTemplateName" to specify the editor template.  Can this be done with autogenerated columns, and if so, how? Is there an example of this being done?


    Thanks in advance,


  2. Stefan
    Stefan avatar
    2922 posts

    Posted 23 Nov 2017 Link to this post

    Hello, Ryan,

    The binding-to-datatable example is working with PopUp edit mode only, and the PopUp editor is using Html.EditorForModel which allows only changing the entire editor temple instead of setting editor for a single column:

    "If the Grid is configured for pop-up editing, the Html.EditorForModel is used to get the editor HTML for the whole model.

    For more information on ASP.NET MVC editor templates, refer to this blog post series on ASP.NET MVC 2 templates.

    For a runnable example on using custom popup templates, refer to this demo.

    Progress Telerik
    Try our brand new, jQuery-free Angular 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