I am getting A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.ApplicationVersion_5873625B844CCA17E07B250096A709DE10780528E07321E64961938506A2A18E'. on cshmle line .Grid(Model)
Below is my code. Please let me know if you need any other information/code sample in order to answer my question.
CSHMTL
=====================================================
@using Infragistics.Web.Mvc
@model IQueryable<OTModel.ApplicationVersion>
@(Html.Infragistics() .Grid(Model) .ID("Grid") .Height("500px") .Width("100%") .AutoGenerateColumns(false) .AutoGenerateLayouts(false) .RenderCheckboxes(true) .PrimaryKey("ApplicationVersionID") .Columns(column => { column.For(x => x.ApplicationVersionID).HeaderText("Version ID").Width("10%"); column.For(x => x.VersionName).HeaderText("Version Name").Width("50%"); column.For(x => x.IsActive).HeaderText("Is Active").Width("25%"); }) .Features(feature => { feature.Updating().ColumnSettings(cs => { cs.ColumnSetting().ColumnKey("ApplicationVersionID").ReadOnly(true); cs.ColumnSetting().ColumnKey("VersionName").Required(true).TextEditorOptions(o => o.ValidatorOptions(vo => vo.MinLength(4).KeepFocus(ValidatorKeepFocus.Never))); cs.ColumnSetting().ColumnKey("IsActive").Required(true) ; }); feature.Sorting(); }) .DataSourceUrl(Url.Action("GetApplicationVersions")) .UpdateUrl(Url.Action("OrdersSaveData")) .DataBind() .Render() )
CONTROLLER
=============================
ApplicationVersion av = OTControlPanelBL.GetApplicationVersionByApplicationID(id).AsQueryable();
return View(av);
Above return list of records, in the above case 4 records
===================================
Hello Muhammad Shoaib Sidd,
Thank you for posting in our forums!
The circular reference exception you are encountering is due to an issue with the EntityFramework and the JSON serializer. Please see Zdravko's response in the following forum thread for ways to resolve this issue.
https://www.infragistics.com/community/forums/f/ignite-ui-for-javascript/90427/circular-reference
If you have any further questions or concerns with this, please let me know and I will be glad to help.
I am sorry that post doesn't help me.
If you see in my controller code there is no JSON call/code, that method is a ActionResult for Edit. If you can exactly point out the issue in code then I would be very thankful considering that I am very new in JSON.
Just to recap. I would like to bind the data to a Editable Infragistics gird. Data is returning from my business layer using EF. My ViewModel is composed of two objects (Header and Detail). I am binding detail object to the grid.
Thanks Shoaib