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

Listview with indefinite types

1 Answer 39 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Eurogiciel
Top achievements
Rank 1
Eurogiciel asked on 28 Mar 2013, 05:08 PM
Hello,

I am trying to use a ListView to edit a list of generic components inside a form. Currently, I am using ASP.NET MVC standard mechanism to automatically choose a template editor using the current element type. All elements extend the same abstract class (which serves as the base model of the list) but I need to display the specific information of each subclass inside the editor.

I want to use ListView to have the possibility to add and remove elements from the list but I don't know how to make the template use the ASP.NET MVC .EditorFor mechanism.

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 01 Apr 2013, 11:09 AM
Hello,

I am not sure if I understand correctly the needed functionality but by default the MVC ListView uses the EditorForModel helper to generate the editor template. If you need to customize its editor then you could define the name of a custom template via the Editable TemplateName method:

Editable(editable => editable.TemplateName("myTemplate"))
Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView
Asked by
Eurogiciel
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or