This question is locked. New answers and comments are not allowed.
Hi all,
I am using this demo as an example:
http://www.telerik.com/community/code-library/aspnet-mvc/grid/using-dropdownlist-to-edit-a-foreign-key-column.aspx
The problem I am having is when trying to bind the query:
I'm not sure how p.Category, does not give a circular reference in this example?
I have an edmx with a table that has FK's to 3 other tables, when I try and do something simliar like 'p.Category', I receive a circular reference on any of the 3 tables.
My intent is to display this in a datagrid, so I tried selecting 'p.Category.CategoryName' and then binding to column.bound(t => t.Category.CategoryName) but the busy indicator
on the grid just continuously spins.
Why do I receive a circular reference when attempting the same as above and/or why is the exact property not coming across?
Thanks!
I am using this demo as an example:
http://www.telerik.com/community/code-library/aspnet-mvc/grid/using-dropdownlist-to-edit-a-foreign-key-column.aspx
The problem I am having is when trying to bind the query:
[GridAction] public ActionResult Select() { var products = new Models.NorthwindEntities().Products; var data = from p in products select new // Use anonymous type to avoid JSON serialization exceptions due to circular object references. Also serialize only the required properties (for performance) { p.Category, p.ProductID, p.ProductName, p.CategoryID }; return View(new GridModel(data)); }I'm not sure how p.Category, does not give a circular reference in this example?
I have an edmx with a table that has FK's to 3 other tables, when I try and do something simliar like 'p.Category', I receive a circular reference on any of the 3 tables.
My intent is to display this in a datagrid, so I tried selecting 'p.Category.CategoryName' and then binding to column.bound(t => t.Category.CategoryName) but the busy indicator
on the grid just continuously spins.
Why do I receive a circular reference when attempting the same as above and/or why is the exact property not coming across?
Thanks!