This is a migrated thread and some comments may be shown as answers.

How to set EditorTemplatName for Auto Generated columns?

1 Answer 22 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 22 Nov 2017, 12:38 AM

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

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 23 Nov 2017, 02:27 PM
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.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or