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

Scaffolder MVC Add button never enabled when using ViewModel

1 Answer 785 Views
Installer and VS Extensions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 04 Nov 2016, 10:23 AM

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

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 07 Nov 2016, 12:32 PM

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.
Tags
Installer and VS Extensions
Asked by
John
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or