Hi Team,
I have around 50k rows in my webdatagrid and I am getting json error while doing a virtual scrolling.
"System.ArgumentException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property."
As suggested in a post on this forum I am using webdatagrid within an updatepanel but still the same. Setting EnableDataViewState="false" or "true" also has the same results.
My markup is given below and the only thing I am doing in code-behind is setting datasource at page load using dataset & assigning same datasource back at postback.
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <ig:WebDataGrid EnableDataViewState="false" EnableAjax="false" ID="grdReport1" runat="server" AutoGenerateColumns="True" Height="350px"> <Behaviors> <ig:VirtualScrolling ScrollingMode="Virtual" DataFetchDelay="500" RowCacheFactor="1" ThresholdFactor=".25" Enabled="true" /> <ig:Filtering Alignment="Top" Visibility="Visible" Enabled="true" AnimationEnabled="true" > <EditModeActions MouseClick="Single" EnableOnActive="true" EnableOnKeyPress="true" /> </ig:Filtering> <ig:Sorting Enabled="true" SortingMode="Single" /> <ig:ColumnResizing /> <ig:ColumnMoving Enabled="true" /> </Behaviors> </ig:WebDataGrid> </ContentTemplate> </asp:UpdatePanel>
Code:
if (!IsPostBack) { Session["DS"] = ds; grdReport1.DataSource = Session["DS"] as DataSet; grdReport1.DataMember = "reportData"; grdReport1.DataBind();
}else{ grdReport1.DataSource = Session["DS"] as DataSet;
}
Any clues?
Hi rohitarora,
A JSON error such as this means that the ajax request was too big. There's a certain length to it. For example, you cannot delete rows with ajax on if the number of rows in the grid is too large. Perhaps try adjusting your Virtual Scrolling properties? Does this happen if you take the grid out of the update panel?
regards,
David Young
Hi David,
I tried without updatepanel first but that wasn't working. So, as suggested by this forum, I tried putting it in updatepanel but that is also not working. I have also tried various combination of virtual scrolling properties but none of them seems to be working. Do you want me to try anything specific. My current set of properties are there in markup above. thanks.