Hi,
I have a webdatagrid were I enabled sorting, but it doesn't seem to work, I receive a javascript error.
Error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.Parameter name: data
Here you have a sample of the webdatagrid
<ig:WebDataGrid ID="WebDataGrid1" runat="server" DataKeyFields="ID" AutoGenerateColumns="False" EnableAjax="true" Width="602px" ShowFooter="true"><Columns> <ig:TemplateDataField Key="DateTime" Width="150px"> <ItemTemplate> <%#DataBinder.Eval(CType(Container, Infragistics.Web.UI.TemplateContainer).DataItem, "DateTime")%> </ItemTemplate> <Header Text="DateTime" /> </ig:TemplateDataField> <ig:TemplateDataField Key="Component" Width="363px"> <ItemTemplate> <%#DataBinder.Eval(CType(Container, Infragistics.Web.UI.TemplateContainer).DataItem, "Component")%> </ItemTemplate> <Header Text="Component" /> </ig:TemplateDataField> <ig:TemplateDataField Key="Sevirity" Width="65px"> <ItemTemplate> <img src="img/sevirity<%#DataBinder.Eval(CType(Container, Infragistics.Web.UI.TemplateContainer).DataItem, "Sevirity").ToString().Trim()%>.png" alt="" /> </ItemTemplate> <Header Text="Sevirity" /> </ig:TemplateDataField></Columns><Behaviors> <ig:Sorting SortingMode="Multi" Enabled="true"> <ColumnSettings> <ig:SortingColumnSetting ColumnKey="DateTime" Sortable="true"/> <ig:SortingColumnSetting ColumnKey="Component" Sortable="true"/> <ig:SortingColumnSetting ColumnKey="Sevirity" Sortable="true"/> </ColumnSettings> </ig:Sorting></Behaviors></ig:WebDataGrid>
I have a DataTable which I bind to the WebDataGrid.
WebDataGrid1.DataSource = dtWebDataGrid1.DataBind()
How can I fix this problem?
Edit:
I was able to catch the following information:
Source: Infragistics35.Web.v9.1
Class: Sorting
Stacktrace:
at Infragistics.Web.UI.GridControls.Sorting.BehaviorEvents_PreRender(Object sender) at Infragistics.Web.UI.GridControls.GridBehaviorEvents.RenderingContentHandler.Invoke(Object sender) at Infragistics.Web.UI.GridControls.GridBehaviorEvents.OnRenderingContent() at Infragistics.Web.UI.GridControls.GridRenderer.RenderContents(HtmlTextWriter writer) at Infragistics.Web.UI.Framework.RunBot.HandleRenderContents(HtmlTextWriter writer, RendererBase renderer) at Infragistics.Web.UI.GridControls.WebDataGrid.GetRenderHTML() at Infragistics.Web.UI.GridControls.WebDataGrid.CallbackRender(CallbackObject callbackObject) at Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.Infragistics.Web.UI.IControlCallback.CallbackRender(CallbackObject callbackObject) at Infragistics.Web.UI.Framework.RunBot.CallbackRenderRecursive(CallbackObject callbackObject) at Infragistics.Web.UI.Framework.RunBot.RenderFormCallBack(HtmlTextWriter writer, Control control) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at Infragistics.Web.UI.Framework.RunBot.RenderPageCallBack(HtmlTextWriter writer, Control control) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Hello,
That's an interesting case. Are there any special characters in your data? How big is the data source?
I'm getting this exact same error. There are no special characters and the data source is 3 rows + 4 columns (just a test DataTable set to the Grid's datasource).
The interesting thing is it worked without a hitch on the VS2008 dev server (right click -> View in Browser). But I got the error when I tried to navigate to the page hosted in IIS.
As I was typing this I was debugging something else. And the problem is now gone. I don't recall all I did, I reset IIS several times but I'm not sure if I did so after seeing this error. I did disable and reenable AJAX on the grid. I wish I had written down specifically what I did. I apologize!
I'm going to post this anyway in case someone else has this same issue and finds this thread via google like me. I'm running XP Professional with IIS 5.1, VS2008 SP1, .NET 3.5 SP1, and Infragistics ASP.NET 9.1. I can't give much advice except that the problem may go away magically without you having to reconfigure IIS or get crazy with anything.
Best of luck,-Pete