This question is locked. New answers and comments are not allowed.
I have come across the circular reference issue whilst trying to use Ajax databinding with the grid. There is a blog discussing this issue, but the following link is broken circular reference was detected blog Can this be made available again please?
Many Thanks,
Lee.
Many Thanks,
Lee.
4 Answers, 1 is accepted
0
Accepted
Hello Lee,
The blog post is available at the following URL:
http://blogs.telerik.com/aspnetmvcteam/posts/10-01-25/resolving_circular_references_when_binding_the_mvc_grid.aspx
Greetings,
Dimo
the Telerik team
The blog post is available at the following URL:
http://blogs.telerik.com/aspnetmvcteam/posts/10-01-25/resolving_circular_references_when_binding_the_mvc_grid.aspx
Greetings,
Dimo
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Radu
Top achievements
Rank 1
answered on 21 Jun 2011, 07:53 PM
Hi,
First, thanks for the link. It does clarify a few issues, but I'm in the following configuration:
MVC 3
Telerik 2011.1.315
and Entity Framework 4.1 in Code-First mode.
Of the provided solutions; using Server-side binding is not an option; I have a pretty big project, so ViewModel definitely would be a last resort.
Can you please give an example of how the second solution ("Avoid generating reference properties") can be implemented for EF Code-First mode?
Many thanks!
First, thanks for the link. It does clarify a few issues, but I'm in the following configuration:
MVC 3
Telerik 2011.1.315
and Entity Framework 4.1 in Code-First mode.
Of the provided solutions; using Server-side binding is not an option; I have a pretty big project, so ViewModel definitely would be a last resort.
Can you please give an example of how the second solution ("Avoid generating reference properties") can be implemented for EF Code-First mode?
Many thanks!
0
Hello Radu,
where data context has following declaration:
Regards,
Rosen
the Telerik team
You may disable serialization of the navigation properties by disabling the ProxyCreation options of the DataContext.
[GridAction]public ActionResult _Select(){ var db = new Northwind(); db.Configuration.ProxyCreationEnabled = false; return Json(new GridModel(db.Products));}where data context has following declaration:
public class Product{ public int ProductID { get; set; } public string ProductName { get; set; } public decimal? UnitPrice { get; set; } public int CategoryID { get; set; } public virtual Category Category { get; set; }}public class Category{ public int CategoryID { get; set; } public string CategoryName { get; set; } public string Description { get; set; }}public class Northwind : DbContext{ public DbSet<Category> Categories { get; set; } public DbSet<Product> Products { get; set; }}Regards,
Rosen
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Lee
Top achievements
Rank 1
answered on 24 Jun 2011, 10:26 AM
Hi Dimo,
Thanks very much for the link. After giving the users a quick demo they didn't want an editable grid after all so this resolved the issue as I no longer needed to have Ajax support.
Many Thanks again,
Lee.
Thanks very much for the link. After giving the users a quick demo they didn't want an editable grid after all so this resolved the issue as I no longer needed to have Ajax support.
Many Thanks again,
Lee.
