Answered by:
ASP.Net MVC3 View with Kendo Grid Control rendering data in Json format

Question
-
User248087600 posted
Hi all,
Scenario:
I am using kendo grid for binding and displaying data from database. but Json formatted data of Product table record getting rendered on browser. I am expecting data in kendo Grid.
this is my controller code
public ActionResult Products_Read([DataSourceRequest]DataSourceRequest request)
{
using (var northwind = new NorthwindEntities())
{
IQueryable<Product> products = northwind.Products;
DataSourceResult result = products.ToDataSourceResult(request);
return Json(result);
}
}and this is my view code
@(Html.Kendo().Grid<KendoGridAjaxBinding.Models.Product>()
.Name("grid")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Products_Read", "Home"))
)
.Columns(columns =>
{
columns.Bound(product => product.ProductID);
columns.Bound(product => product.ProductName);
columns.Bound(product => product.UnitsInStock);
})
.Pageable()
.Sortable()
)Please help me to resolve the same.
Thanks.
Friday, August 14, 2015 6:50 AM
Answers
-
User-219423983 posted
Hi Tathagat,
I’m very sorry for my mistake. The right URL that I wanted to provide is below.
http://www.codeproject.com/Articles/606682/Kendo-Grid-In-Action#Creating%20grid%20from%20JSON%20Data
Best Regards,
Weibo Zhang
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, August 19, 2015 9:00 AM
All replies
-
User-219423983 posted
Hi abid.abk,
Welcome to ASP.NET Forums.
I think you could refer to the following article, it provides you very detailed tutorial to operate the 3<sup>rd</sup> party tool “kendo grid”, especially the “Creating grid from JSON Data” section would be very helpful.
I hope it’s useful to you.
Best Regards,
Weibo Zhang
Friday, August 14, 2015 9:40 AM -
User526547007 posted
You pasted the same link. It does not work by the way
Tuesday, August 18, 2015 4:50 PM -
User-219423983 posted
Hi Tathagat,
I’m very sorry for my mistake. The right URL that I wanted to provide is below.
http://www.codeproject.com/Articles/606682/Kendo-Grid-In-Action#Creating%20grid%20from%20JSON%20Data
Best Regards,
Weibo Zhang
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, August 19, 2015 9:00 AM -
User248087600 posted
Thank you very much Weibo Zhang.
Friday, September 4, 2015 12:49 AM