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
340
Cannot serialize non finite number
posted

Hi there,

I'm using a webdatagrid and have batchUpdating enabled. I add all my rows client-side with this

function AddMarks() {
var grid = $find("<%=wdgMarks.ClientID %>");
//var row = new Array(grid.get_rows().length, "ExamMarkId", "ExaminationId", "Mark", "Enhanced", "DateModified", "ModifiedBy"); // create a new empty row

var mark = $get("<%=ddlMarkFrom.ClientID%>").value + $get("<%=ddlMarkFrom2.ClientID %>").value;
var row = new Array(grid.get_rows().length+1, $get('<%=hfExamID.ClientID %>').value, mark, $get("<%=chkEnhanced.ClientID %>").checked , "<%=DateTime.Now.ToShortDateString() %>", "<%=Page.User.Identity.Name%>"); // create a new empty row

grid.get_rows().add(row);
}

The markup for the grid is

<ig:WebDataGrid ID="wdgMarks" runat="server" AutoGenerateColumns="False"
DataSourceID="edsMarks" EnableAjax="False" Height="350px" Width="100%"
onrowadding="wdgMarks_RowAdding" onrowsdeleting="wdgMarks_RowsDeleting">
<Columns>
<ig:BoundDataField DataFieldName="SomeId" Hidden="True" Key="SomeId" >
<Header Text="SomeId" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="SomethingElse" Hidden="True"
Key="SomethingElse">
<Header Text="SomethingElse" />
</ig:BoundDataField>
<ig:TemplateDataField Key="Mark">
<Header Text="Mark" />
<ItemTemplate>
<%# Goddard.DAL.Utility.IntToBase26((int)DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "Mark"))%>
</ItemTemplate>
</ig:TemplateDataField>
<ig:BoundCheckBoxField DataFieldName="Enhanced" Key="Enhanced">
<Header Text="Enhanced" />
</ig:BoundCheckBoxField>
<ig:BoundDataField DataFieldName="DateModified" Key="DateModified">
<Header Text="DateModified" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="ModifiedBy" Key="ModifiedBy">
<Header Text="ModifiedBy" />
</ig:BoundDataField>

</Columns>
<ClientEvents KeyDown="wdgMarks_Grid_KeyDown" />
<Behaviors>
<ig:EditingCore AutoCRUD="False" BatchUpdating="True">
<Behaviors>
<ig:RowAdding Enabled="False">
</ig:RowAdding>
<ig:RowDeleting />
</Behaviors>
</ig:EditingCore>
<ig:Selection CellClickAction="Row" RowSelectType="Single">
</ig:Selection>
<ig:RowSelectors>
</ig:RowSelectors>
</Behaviors>
</ig:WebDataGrid>

and that all seems to work fine.

However, when I post-back I get an error stating that

Line: 4211
Error: Sys.InvalidOperationException: Cannot serialize non finite numbers.


That happens a few times, then the page does it's postback, but none of the grid update events are fired.


Please advise.