Hi Guys
I am having issues using grid in asp.net core 2.0 could you give me an example asp.net core 2.0 Mvc application with a grid (CRUD)
Many
Thanks
Hi Farveen,
Thanks for update I have attached my application which is different to yours I still have issue with view data being returned as null and other issues when you run Brand Controller and view.
Thanks for your help
public ActionResult Index()
{
List<dynamic> dynList = new List<dynamic>() {
new {BrandId = 1, BrandName = "Elevator", BrandDescription="Vertical Pop" },
new {BrandId = 2, BrandName = "Stairs", BrandDescription="Fitness" }
};
ViewBag.branddatasource = dynList;
return View();
}
|
Hi Farveen,
The example you have sent me does not work please change it to read and write data to a MSSQL express database , that is what I am trying to do your example does not use EF and external sql database
Regards
Edmund Herbert
<ej-grid id="FlatGrid" allow-paging="true" > <e-datamanager json="(IEnumerable<object>)ViewBag.datasource" insert-url="/Home/NormalInsert"adaptor="remoteSaveAdaptor" /> <e-edit-settings allow-adding="true"/> <e-toolbar-settings show-toolbar="true" toolbar-items="@(new List<string> { "add", "update", "cancel"})"/> <e-columns> <e-column field="OrderID" header-text="Order ID" text-align="Right" is-primary-key="true"></e-column> . .. . .. </e-columns> </ej-grid> public ActionResult NormalInsert([FromBody]CRUDModel<Orders> param) { _context.Add(param.Value); _context.SaveChangesAsync(); return Json(param.Value); } public IActionResult Index() { ViewBag.datasource = (IEnumerable)_context.Orders.ToList(); return View(); } |
Hi Issue with view returning null,
fixed please remember in startup file to add