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

JSON serialization error when populating selfreferenceHierarchy grid

5 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Luka
Top achievements
Rank 1
Luka asked on 18 Sep 2011, 12:30 PM
Hi,
I have a collection of about 500 classes I need to display in Telerik RadGrid.
The classes have a parent-child relationships data.
I have configured the grid like in examples for self-reference hierarchy, but when I run the application I get the following error:
Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

The Parent property: GrpParentDeptId
Child property: GrpDeptId

I don't know why is this happening. I have only 500 rows!!!
I also tried setting the 
<system.web.extensions>  
   <scripting>  
       <webServices>  
          <jsonSerialization maxJsonLength="2147483644" />
       </webServices>  
   </scripting>  
</system.web.extensions>
but with no luck.
I am sending you the attachment with the views, code-behind, and the data xml I am pooling the data from.

Please help.
:-(

5 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 18 Sep 2011, 05:02 PM
Hello,

This property has by default 2097152 characters (approx. 4MB of data).

You can increase this length  by"<jsonSerialization maxJsonLength="50000000"/>"

http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.maxjsonlength.aspx

Thanks,
Jayesh Goyani
0
Luka
Top achievements
Rank 1
answered on 18 Sep 2011, 08:14 PM
thanks,
but as I already specified in my question..I already set this value to its maximum of int32 and it didn't work.
:-(
0
Iana Tsolova
Telerik team
answered on 22 Sep 2011, 07:51 AM
Hello Luka,

Can you send a live Url where we can observe the issue and see if we can find something there?

Regards,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Luka
Top achievements
Rank 1
answered on 22 Sep 2011, 12:47 PM
Hi,
Today I found that my web.config setting for "<jsonSerialization maxJsonLength="50000000"/>" is being ignorred and it is set to the default value.
Then I switched to the Server-OnDemand and all worked fine.

I don't know why <jsonSerialization maxJsonLength="50000000> is being ignored.

Anyway I think that for me it is fine working on server-ondemand.

thanks
0
Nick Smith
Top achievements
Rank 1
answered on 27 Sep 2011, 10:05 PM
I am having the same problem what server on demand did you switch to.. What is that setting?
Tags
Grid
Asked by
Luka
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Luka
Top achievements
Rank 1
Iana Tsolova
Telerik team
Nick Smith
Top achievements
Rank 1
Share this question
or