Scaffolder MVC Add button never enabled when using ViewModel

2 posts, 1 answers
  1. John
    John avatar
    3 posts
    Member since:
    Dec 2014

    Posted 04 Nov Link to this post

    When I use the Kendo UI scaffolder for MVC and choosing "Use Existing ViewModel" the "Add" button remains disabled in the final dialog so I can never complete the process unless I also select a data model and DbContext. I have tried this with each of the available widgets the scaffolder supports as well as many combinations of options. Environment is: vs2015, MVC UI 2016.3.1028, EF 6.1, .Net 4.5.2  

    Steps: 1) right click on "Controllers" in Solution Explorer

    2) Select Add, Controller

    3) In the Add Scaffold dialog select MVC Kendo UI Scaffolder and Add

    4) In the Kendo UI Scaffolder dialog, select UI for MVC Grid (or any other widget) and Add

    5) In the widget specific dialog set Controller name,  View name, check the "Use Existing ViewModel" box, select a View Model

    At this point the "Add" button remains disabled regardless of any additional selections of options.  The only way to get the Add button to become enabled is to also select a Data Model and DbContext.

    Thanks, John

  2. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 07 Nov Link to this post

    Hello John,

    The described behavior is the expected one for the Scaffolder. It is mandatory to select a Model and a DbContext classes. The ViewModel options serves as an "add-on" on top of the Model class and requires the names of the properties to be exactly the same as the ones from the Model Entity class. Additional information can be found on the following documentation page:

    http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/scaffolding

    Regards,
    Dimiter Madjarov
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top