Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
159
Json error
posted

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?