How to set EditorTemplatName for Auto Generated columns?

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

    Posted 21 Nov Link to this post

    Hi,

    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,

    Ryan

  2. Stefan
    Admin
    Stefan avatar
    1394 posts

    Posted 23 Nov 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:

    https://docs.telerik.com/aspnet-mvc/helpers/grid/templating/editor-templates#configuration

    "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.
    "

    Regards,
    Stefan
    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