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

Scaffolding Issue with VS 2017

12 Answers 233 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ahmed
Top achievements
Rank 1
Ahmed asked on 19 Nov 2017, 08:24 AM

We downloaded the telerik toolkit trial and then downloaded MVC VSExtentions for VS 2017 but we didnt find the add new scaffolding item. would you please help?

 

12 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 21 Nov 2017, 01:49 PM
Hello Ahmed,

Could you try to install the extensions manually from wrappers\aspnetmvc\Scaffolding. The entire process is described in the following documentation article:

https://docs.telerik.com/aspnet-mvc/getting-started/scaffolding

Regards,
Nencho
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.
0
Ahmed
Top achievements
Rank 1
answered on 22 Nov 2017, 10:02 AM

folder scaffolding not exist under C:\Program Files (x86)\Progress\Telerik UI for ASP.NET MVC R3 2017\wrappers\aspnetmvc

0
Nencho
Telerik team
answered on 24 Nov 2017, 07:57 AM
Hello Ahmed,

Please excuse my mistake, as I missed the fact that you are using VS2017. I am afraid that at the time being, the Scaffolding is not supported with the version of the Visual Studio. This is also the reason why, when the installator is ran, we check for the VS version and if there is only 2017 instance, the Scaffolding folder is never deployed.

Regards,
Nencho
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.
0
David
Top achievements
Rank 1
answered on 07 Mar 2018, 03:27 PM
Is there any update on this issue?
0
Nencho
Telerik team
answered on 09 Mar 2018, 08:56 AM
Hello David,

Yes, the issue had been fixed - you should be able to scaffold items in VS2017 with our latest official release as well.

Regards,
Nencho
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.
0
ITDept
Top achievements
Rank 1
answered on 04 Apr 2019, 07:13 PM
Do you know of any reason why when I use Scaffolding with an ADO.Net Entity Data Model that it generates all the code, and even displays the column headers in the GridView.  But, it will never display the data in the table even though there is data there?
0
ITDept
Top achievements
Rank 1
answered on 05 Apr 2019, 04:07 PM
I am able to use  create a scaffolding item using just the MVC Controller with views, and using the same entity framework   The regular scaffolding does does return data from the same data entity model that I am trying to use with the kendo ui scaffolding that does not work.  Any help would be appreciated.
0
Nencho
Telerik team
answered on 08 Apr 2019, 12:28 PM
Hello Ahmed,

I am afraid that we are not aware of such an issue. Could you clarify, if you are able to track that the EF model cannot return any data, or the data is there, but the never rendered in the widget? Also, can you try adding new ADO service to mimic the same that the scaffolding functionality does, but manually? This way we can scope the issue to not correct model creation and investigate the issue deeper. 

Regards,
Nencho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
ITDept
Top achievements
Rank 1
answered on 08 Apr 2019, 04:06 PM

Nencho,

Thank you for your response.  I will explain:

I have setup a working ADO.NET Entity Data Model and as a part of it I am connecting to a table called UPCI_DistrictLookup.  Here is the file that was generated by that:

namespace UPCIkuiApps.Models
{
    using System;
    using System.Collections.Generic;
    
    public partial class UPCI_DistrictLookup
    {
        public long RecordId { get; set; }
        public long District { get; set; }
        public string Country { get; set; }
        public string State { get; set; }
        public string ZipPostal { get; set; }
    }
}

I know this entity data model returns results because if I create the scaffolding item using "Add Scaffold", "MVC 5 Controller with views, using Entity Framework" and I select the model class created by the data entity model class called UPCI_DistrictLookup and have it generate the controller and views for me, they work.  Here is the working controller:

 

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using UPCIkuiApps.Models;

namespace UPCIkuiApps.Controllers
{
    public class UPCI_DistrictLookupWorkingController : Controller
    {
        private SE_PRODEntities db = new SE_PRODEntities();

        // GET: UPCI_DistrictLookupWorking
        public ActionResult Index()
        {
            return View(db.UPCI_DistrictLookup.ToList());
        }

        // GET: UPCI_DistrictLookupWorking/Details/5
        public ActionResult Details(long? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            UPCI_DistrictLookup uPCI_DistrictLookup = db.UPCI_DistrictLookup.Find(id);
            if (uPCI_DistrictLookup == null)
            {
                return HttpNotFound();
            }
            return View(uPCI_DistrictLookup);
        }

        // GET: UPCI_DistrictLookupWorking/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: UPCI_DistrictLookupWorking/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Create([Bind(Include = "RecordId,District,Country,State,ZipPostal")] UPCI_DistrictLookup uPCI_DistrictLookup)
        {
            if (ModelState.IsValid)
            {
                db.UPCI_DistrictLookup.Add(uPCI_DistrictLookup);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(uPCI_DistrictLookup);
        }

        // GET: UPCI_DistrictLookupWorking/Edit/5
        public ActionResult Edit(long? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            UPCI_DistrictLookup uPCI_DistrictLookup = db.UPCI_DistrictLookup.Find(id);
            if (uPCI_DistrictLookup == null)
            {
                return HttpNotFound();
            }
            return View(uPCI_DistrictLookup);
        }

        // POST: UPCI_DistrictLookupWorking/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Edit([Bind(Include = "RecordId,District,Country,State,ZipPostal")] UPCI_DistrictLookup uPCI_DistrictLookup)
        {
            if (ModelState.IsValid)
            {
                db.Entry(uPCI_DistrictLookup).State = EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }
            return View(uPCI_DistrictLookup);
        }

        // GET: UPCI_DistrictLookupWorking/Delete/5
        public ActionResult Delete(long? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            UPCI_DistrictLookup uPCI_DistrictLookup = db.UPCI_DistrictLookup.Find(id);
            if (uPCI_DistrictLookup == null)
            {
                return HttpNotFound();
            }
            return View(uPCI_DistrictLookup);
        }

        // POST: UPCI_DistrictLookupWorking/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public ActionResult DeleteConfirmed(long id)
        {
            UPCI_DistrictLookup uPCI_DistrictLookup = db.UPCI_DistrictLookup.Find(id);
            db.UPCI_DistrictLookup.Remove(uPCI_DistrictLookup);
            db.SaveChanges();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}

 

And here is the working view:

@model IEnumerable<UPCIkuiApps.Models.UPCI_DistrictLookup>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Country)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.State)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ZipPostal)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Country)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.State)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ZipPostal)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
            @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
            @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
        </td>
    </tr>
}

</table>

 

Then, when I do the same thing using the Kendo UI scaffolding.  It creates this controller:

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;
using UPCIkuiApps.Models;

namespace UPCIkuiApps.Controllers
{
    public class UDistLookupController : Controller
    {
        private SE_PRODEntities db = new SE_PRODEntities();

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult UPCI_DistrictLookup_Read([DataSourceRequest]DataSourceRequest request)
        {
            IQueryable<UPCI_DistrictLookup> upci_districtlookup = db.UPCI_DistrictLookup;
            DataSourceResult result = upci_districtlookup.ToDataSourceResult(request, uPCI_DistrictLookup => new {
                RecordId = uPCI_DistrictLookup.RecordId,
                Country = uPCI_DistrictLookup.Country,
                State = uPCI_DistrictLookup.State,
                ZipPostal = uPCI_DistrictLookup.ZipPostal
            });

            return Json(result);
        }

        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }
    }
}

And it creates this view which does return the column headers, but nothing shows in the data.

<div id="grid"></div>
<script>
    $("#grid").kendoGrid({
        height: 400,
        columns: [
            {field: "Country"},
            {field: "State"},
            {field: "ZipPostal"}
        ],
        dataSource: {
            type: "aspnetmvc-ajax", 
            transport: {
                read: {
                     url: "UPCI_DistrictLookup_Read"
                }
},
            schema: {
                data: "Data",
                model: {
                    id: "RecordId",
fields: {
RecordId: { type: "number"},
District: { type: "number"},
Country: { type: "string"},
State: { type: "string"},
ZipPostal: { type: "string"}
}
                }
            }, 
serverPaging: true,
serverSorting: true,
serverSorting: true,
        },
        scrollable: true
    })

</script>

Thank you for your help.

 

0
Nencho
Telerik team
answered on 10 Apr 2019, 01:44 PM
Hello,

Thank you for the detail information and code snippet provided.

I tried to follow the instructions and a schema, close to the one demonstrated below (for underlying data), but I am still unable to replicate the described issue - the objects are correctly generated and data is properly loaded.

That said, I would like to ask you to submit a new support thread, along with your project attached, which we can use for local test purposes and pin down the reason for the issue.

Thank you in advance for your cooperation.

Regards,
Nencho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
ITDept
Top achievements
Rank 1
answered on 10 Apr 2019, 02:39 PM
Thanks.  I did submit a ticket some time ago but it has been stumbling along with no progress.  So, i was trying to find other help.
0
Nencho
Telerik team
answered on 12 Apr 2019, 02:01 PM
Hello Ahmed,

I have informed the colleague, who is assisting you in the other thread and passed the information discussed in this one. Please continue the correspondence in the other thread, in order to avoid any duplication and confusion.

Thank you in advance!

Regards,
Nencho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Ahmed
Top achievements
Rank 1
David
Top achievements
Rank 1
ITDept
Top achievements
Rank 1
Share this question
or