Can one swop out DefaultJavaScriptSerializer

2 posts, 0 answers
  1. Shawn
    Shawn avatar
    49 posts
    Member since:
    Jul 2011

    Posted 09 Aug 2012 Link to this post

    I am getting the following error when binding my Model to a Kendo Grid.
    InvalidOperationException: A circular reference was detected while serializing an object of type [my type here]

    Using the Json.Net serializer with a setting to ignore circular references I am able to get my type serialized without error. So, what I'd like to be able to do is to tell the Kendo framework to use the Json.Net serializer instead of its own built-in DefaultJavaScriptSerializer.  Is this possible?  I see it implements an IJavaScriptSerializer interface, so I'm hoping I can create my own class that implements this interface (and uses the Json.Net serializer).  But I can't figure out how one would tell the Kendo.Mvc.Infrastructure to use my custom implementation of IJavaScriptSerializer.
    Please help.
  2. JFB
    JFB avatar
    6 posts
    Member since:
    Oct 2012

    Posted 11 Oct 2012 Link to this post

    I am having the same problem...

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

                                               
    @(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)       
         )
    )
       
                                                
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top