I'm using a webhiearchicaldatagrid (whdg1) and have been receiving the following error repeatedly on the 4th round trip to the server:
"System.ArgumentException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property."
How do I correct this?
Thank you
Hi ClaySeifert,
There is a limit to how much information can be passed between the server and client in a Ajax call. If it it is too big, you get this exception. If you don't have load on demand, you could try using that. If you already have that on, there might be too much data. You could try paging. Lastly, if all else fails, you could turn off ajax on the grid and wrap it in an update panel.
regards,
David Young
Hello David
Thank you for your quick response.
I've tried each of your recomendations except for the Load On Demand and Paging. To my knowledge, Load On Demand is not available in a webhiearachicaldatagrid and the paging only applies when the chid grid is displayed. I tried the Manual Load On Demand using the RowIslandsPopulating event and that works perfectly except I'm unable to hide a column and it too throws the JSON error but not as frequently.
Question, when the page loads, it is retrieving roughly 3 meg of data in a listbox (roughly 4500 records each 35 bytes). What kind of a limit am I looking at? The data is what it is and I'm about out of options unless you can suggest something else.
Thanks in adsvance
Hi,
LoadOnDemand is available in the WHDG. It is controlled by InitialDataBindDepth property. By default, it is 0, so it will fetch children as they are requested. If you do manual load on demand, make sure that the column is hidden on the ContainerGrid column, not just the Band column. What about turning off ajax (EnableAjax="false") and an update panel did not work?
-Dave
Hi David
When I did the manual load on demand, I had the InitialDataBindDepth set to 0 and the column was hidden in both grids. As far as turning ajax off, I did that for both ajax and enableajaxviewstate with and without an updatepanel. Still the same problem. I believe the problem is the size of the listbox. The user wanted to have the customer names in the listbox but I'm going to scrap that and force them to enter the name. Will let you know the outcome.
Thanks
Clay
Hello
As promised, I said that I would get back with an update on my situation. As it turns out, the problem wasn't with the WebHiearchicalDataGrid. It was with the WebDropDown listbox returning too much data. I was able to fix it by setting the following parameters:
EnableAutoFiltering="Server" EnableLoadOnDemand="True"
Hope this clears things up for all interested.