Listview with indefinite types

2 posts, 0 answers
  1. Eurogiciel
    Eurogiciel avatar
    1 posts
    Member since:
    Mar 2013

    Posted 28 Mar 2013 Link to this post


    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
  2. Daniel
    Daniel avatar
    2109 posts

    Posted 01 Apr 2013 Link to this post


    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"))
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET AJAX banner
Back to Top