This is a migrated thread and some comments may be shown as answers.

InvalidOperationException: A circular reference was detected while serializing an object of type

1 Answer 351 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JFB
Top achievements
Rank 1
JFB asked on 11 Oct 2012, 01:59 PM
I am getting the following error when binding my Model to a Kendo Grid.

A circular reference was detected while serializing an object of type [my type]

What is strange is that the type of the object that is causing the circular reference is not the same as the type of object of the Model for this page... ie:

@model IEnumerable<Models.Type>
Is not the same type that is causing this error. What could be the problem?

@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Name).Groupable(false);
    })
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()  
    .DataSource(dataSource => dataSource      
        .Ajax()
        .ServerOperation(false)      
     )
)

1 Answer, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 16 Oct 2012, 12:20 PM
Hi,


From the provided information it's not clear what is the reason for this behaviour, however the circular reference exception is caused by relations between one entity and other entities and most probably there is relation between the two classes. Could you please provide more information about your current setup or provide run-able example where the issue can be reproduced?

Also please note that we have addressed How to avoid circular reference exception in our Grid FAQ. 


Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
JFB
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or