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

Error: Maximum number of items that can be serialized or deserialized in an object graph is 65536

4 Answers 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sam Grow
Top achievements
Rank 1
Sam Grow asked on 14 Jun 2010, 08:54 PM
Hi,

I followed the video below step by step and was able to create a SL4 application using the RadGridView, EF4 and WCF RIA Services. 
http://tv.telerik.com/silverlight/radgridview/optimizing-radgridview-silverlight

Everything works great using a small SQL Database like Northwind.  However, when I tried creating the exact same project using the larger AdventureWorks database using the SalesOrderHeaders table, I get an error when I run it.  It does not seem to matter what table I use as long as it has more than a few hundred records in it.  Very small tables work fine (like in the Northwind database).

I traced the cryptic "Error NotFound" message using SvcTraceViewer.exe and it displayed the following error:
There was an error while trying to serialize parameter http://tempuri.org/:GetSalesOrderHeadersResult. The InnerException message was 'Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota. '.  Please see InnerException for more details.

I tried to increase the maxItemsInObjectGraph in the Web.Config to a very high number but still received the above error.  Here is the setting I have in the Web.Config.

<services>

      <service name="RadControlsSilverlightApp4.Web.DomainService1" behaviorConfiguration="RadControlsSilverlightApp4-Web-DomainService1">  </service>

    </services>

    <behaviors>

      <serviceBehaviors>

        <behavior name="RadControlsSilverlightApp4-Web-DomainService1">

          <serviceMetadata httpGetEnabled="True"  />

          <serviceAuthorization impersonateCallerForAllOperations="false"/>

          <serviceDebug includeExceptionDetailInFaults="true" />

          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>

        </behavior>

      </serviceBehaviors>

    </behaviors>



What do I need to do to prevent this error?  My goal is to load the RadGridView with thousands of records like you have shown in your performance examples.  However, any time I tried to load the RadGridView with more than a few hundred records I get this error.  Any ideas?

Regards,
Sam

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 15 Jun 2010, 06:11 AM
Hi,

 It will be better if you use paging. Loading your entire collection on the Silverlight client will cause serious communication and performance problems. You can check for example my blog post where RadGridView is bound to almost 2 mil. records and all operations like sorting, grouping, paging, etc are applied server-side. 

Best wishes,
Vlad
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
Sam Grow
Top achievements
Rank 1
answered on 18 Jun 2010, 10:15 PM
Hi Vlad,

I was able to get your example working using the Paging control, however I am trying to display a scrollable grid just like the one that is shown on the Telerik web site with all that data. http://www.telerik.com/products/silverlight/resources/silverlight-performance.aspx

When I add the paging control, I now have to click the paging buttons at the bottom of the page to move to the next page instead of just scrolling through thousands of records in the grid like the RadGridView performance demos show.

How can I get the grid to perform like the link above using UI Virtualization and a large table?  Do I still need to use the paging control with some other settings?

Regards,
Sam
0
Vlad
Telerik team
answered on 21 Jun 2010, 06:13 AM
Hi Sam,

 Our performance demo is focused mainly on UI Virtualization and all data are generated completely client-side. You can try approach demonstrated in this blog post.

Greetings,
Vlad
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
Rob Conley
Top achievements
Rank 1
answered on 01 Aug 2010, 07:33 PM
Vlad,

This seems to be a fairly common problem, with a variety of suggestions that mostly don't seem to work.

If Telerik can add a clear explanation of how to fix it, it would be very helpful as sometimes there is a need to return a large set.

Rob

Finally found something that worked at http://forums.silverlight.net/forums/p/183273/425684.aspx (see post about *not* including a "services" tag and *not* naming the behavior)
Tags
General Discussions
Asked by
Sam Grow
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Sam Grow
Top achievements
Rank 1
Rob Conley
Top achievements
Rank 1
Share this question
or