Using WebDataGrid version 4.11.2. I recieve the following error:("Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'Boolean' cannot be converted to type 'String'. Parameter name: value") when ever the checkbox field is checked after a postback. Works fine when then page first loads but after clicking the save button to perform a batch update, or checking an asp:Checkbox with Autopostback set to refresh the page and show only the check items this error is thrown and I dont' know how I can correct it. Please Help! My Code below:
ASP Source :
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="568px" Width="1106px"
StyleSetName="ElectricBlue" AutoGenerateColumns="False"
DataSourceID="Sql_Manage_DataSource" BorderStyle="Ridge"
DataMember="DefaultView" DataKeyFields="Row_ID">
<Columns>
<ig:BoundDataField DataFieldName="Row_ID" Hidden="False" Key="Row_ID" Width="70px" DataType="System.Int32" >
<Header Text="Record #"/>
<Header Text="Record #"></Header>
</ig:BoundDataField>
<ig:BoundCheckBoxField DataFieldName="Removed" Key="Removed" Width="70px"
DataType="System.Boolean" >
<Header Text="Remove" />
<Header Text="Remove"></Header>
</ig:BoundCheckBoxField>
<ig:BoundDataField DataFieldName="Member_ID" Key="Membe_ID" Width="85px">
<Header Text="MemberID" />
<Header Text="MemberID"></Header>
<ig:BoundDataField DataFieldName="Group_ID" Key="Group_ID" Width="80px">
<Header Text="GroupID" />
<Header Text="GroupID"></Header>
<ig:BoundDataField DataFieldName="Site_ID" Hidden="True" Key="Site_ID">
<Header Text="Site_ID" />
<Header Text="Site_ID"></Header>
<ig:BoundDataField DataFieldName="SSN" Key="SSN" Width="80px">
<Header Text="SSN" />
<Header Text="SSN"></Header>
<ig:BoundDataField DataFieldName="Last_Name" Key="Last_Name" Width="90px">
<Header Text="Last Name" />
<Header Text="Last Name"></Header>
<ig:BoundDataField DataFieldName="First_Name" Key="First_Name" Width="90px">
<Header Text="First Name" />
<Header Text="First Name"></Header>
<ig:BoundDataField DataFieldName="CHP_Address" Key="CHP_Address" Width="250px">
<Header Text="CHP Address" />
<Header Text="CHP Address"></Header>
<ig:BoundDataField DataFieldName="USPS_Address" Key="USPS_Address"
Width="250px">
<Header Text="USPS Address" />
<Header Text="USPS Address"></Header>
<ig:BoundDataField DataFieldName="State_Address" Key="State_Address"
<Header Text="State Address" />
<Header Text="State Address"></Header>
</Columns>
<Behaviors>
<ig:EditingCore BatchUpdating="True">
<ig:CellEditing>
<ColumnSettings>
<ig:EditingColumnSetting ColumnKey="Row_ID" ReadOnly="true" />
<ig:EditingColumnSetting ColumnKey="Removed" ReadOnly="False" />
<ig:EditingColumnSetting ColumnKey="Member_ID" ReadOnly="true" />
<ig:EditingColumnSetting ColumnKey="Group_ID" ReadOnly="true" />
<ig:EditingColumnSetting ColumnKey="SSN" ReadOnly="true" />
<ig:EditingColumnSetting ColumnKey="Last_Name" ReadOnly="True" />
<ig:EditingColumnSetting ColumnKey="First_Name" ReadOnly="True" />
<ig:EditingColumnSetting ColumnKey="CHP_Address" ReadOnly="True" />
<ig:EditingColumnSetting ColumnKey="USPS_Address" ReadOnly="True" />
<ig:EditingColumnSetting ColumnKey="State_Address" ReadOnly="True" />
</ColumnSettings>
</ig:CellEditing>
<ig:RowEditingTemplate CancelButton="buttonCancel" OKButton="buttonOK">
<ClientBindings>
<ig:RowEditingClientBinding ColumnKey="Row_ID" ControlID="control_Row_ID"
GetValueJavaScript="$get({ClientID}).value"
SetValueJavaScript="$get({ClientID}).value={value}" />
<ig:RowEditingClientBinding ColumnKey="Removed" ControlID="control_Removed"
<ig:RowEditingClientBinding ColumnKey="Membe_ID" ControlID="control_Membe_ID"
<ig:RowEditingClientBinding ColumnKey="Group_ID" ControlID="control_Group_ID"
<ig:RowEditingClientBinding ColumnKey="SSN" ControlID="control_SSN"
<ig:RowEditingClientBinding ColumnKey="Last_Name" ControlID="control_Last_Name"
<ig:RowEditingClientBinding ColumnKey="First_Name"
ControlID="control_First_Name" GetValueJavaScript="$get({ClientID}).value"
<ig:RowEditingClientBinding ColumnKey="CHP_Address"
ControlID="control_CHP_Address" GetValueJavaScript="$get({ClientID}).value"
<ig:RowEditingClientBinding ColumnKey="USPS_Address"
ControlID="control_USPS_Address" GetValueJavaScript="$get({ClientID}).value"
<ig:RowEditingClientBinding ColumnKey="State_Address"
ControlID="control_State_Address" GetValueJavaScript="$get({ClientID}).value"
</ClientBindings>
<Template>
<div style="background-color:white;border:1px solid black;">
Membe_ID:
<asp:TextBox ID="control_Membe_ID" runat="server"></asp:TextBox>
<br/>
Group_ID:
<asp:TextBox ID="control_Group_ID" runat="server"></asp:TextBox>
SSN:
<asp:TextBox ID="control_SSN" runat="server"></asp:TextBox>
Last_Name:
<asp:TextBox ID="control_Last_Name" runat="server"></asp:TextBox>
First_Name:
<asp:TextBox ID="control_First_Name" runat="server"></asp:TextBox>
CHP_Address:
<asp:TextBox ID="control_CHP_Address" runat="server"></asp:TextBox>
USPS_Address:
<asp:TextBox ID="control_USPS_Address" runat="server"></asp:TextBox>
State_Address:
<asp:TextBox ID="control_State_Address" runat="server"></asp:TextBox>
<asp:Button ID="buttonOK" runat="server" OnClientClick="return" Text="OK"
UseSubmitBehavior="False" />
<asp:Button ID="buttonCancel" runat="server" CausesValidation="False"
OnClientClick="return" Text="Cancel" UseSubmitBehavior="False" />
</div>
</Template>
</ig:RowEditingTemplate>
</Behaviors>
</ig:EditingCore>
<ig:ColumnResizing>
</ig:ColumnResizing>
<ig:VirtualScrolling>
</ig:VirtualScrolling>
<ig:Paging PageSize="50">
</ig:Paging>
<ig:Selection ColumnSelectType="Single">
</ig:Selection>
<Templates>
<ig:ItemTemplate ID="WebDataGrid1Template1" runat="server"
TemplateID="TempRemoved">
</ig:ItemTemplate>
</Templates>
</ig:WebDataGrid>
<table>
<tr>
<td class="style13" align="right" valign="bottom">
<asp:Button id="cmdSave" runat="server" Text="Save All"
style="margin-left: 0px" Width="153px"></asp:Button>
</td>
<td valign="middle" class="style14">
<asp:CheckBox id="chkView" runat="server" Font-Bold="True" Text="View Removed" AutoPostBack="True"
ForeColor="#000099" CssClass="ig_ElectricBlueEditSelected" Width="120px"
Height="17px"></asp:CheckBox>
<td valign="middle" class="style15">
<asp:Label id="lblRowCount" runat="server" Font-Bold="True" ForeColor="#000099"></asp:Label>
</tr>
</table>
<asp:SqlDataSource ID="Sql_Manage_DataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:CHPAddressVerificationConnectionString %>"
SelectCommand="usp_GetGrid" SelectCommandType="StoredProcedure"
UpdateCommand="usp_upd_tblUSPS_File" UpdateCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="chkView" Name="Removed" PropertyName="Checked" Type="Boolean" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Row_ID" Type="Int32" />
<asp:Parameter Name="Removed" Type="Boolean" />
</UpdateParameters>
</asp:SqlDataSource>
VB Code Behind :
Imports System
Imports System.Data
Imports Infragistics.Web.UI.GridControls
Partial Class ManageData
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
DirectCast(WebDataGrid1.Columns("Removed"), BoundCheckBoxField).ValueConverter = New DecimalBooleanConverter
End Sub
End Class
Public Class DecimalBooleanConverter
Implements IBooleanConverter
Public ReadOnly Property DefaultFalseValue1 As Object Implements Infragistics.Web.UI.GridControls.IBooleanConverter.DefaultFalseValue
Get
Return 0D
End Get
End Property
Public ReadOnly Property DefaultTrueValue1 As Object Implements Infragistics.Web.UI.GridControls.IBooleanConverter.DefaultTrueValue
Return 20.1D
Public Function IsFalse1(ByVal value As Object) As Boolean Implements Infragistics.Web.UI.GridControls.IBooleanConverter.IsFalse
If value = Nothing Then
Return True
End If
Return DirectCast(value, Decimal) <= 20D
End Function
Public Function IsTrue1(ByVal value As Object) As Boolean Implements Infragistics.Web.UI.GridControls.IBooleanConverter.IsTrue
Return False
Return DirectCast(value, Decimal) > 20D
Error at JScript Function:
Number.parseLocale = function Number$parseLocale(value) {
/// <summary locid="M:J#Number.parseLocale" />
/// <param name="value" type="String"></param>
/// <returns type="Number"></returns>
var e = Function._validateParams(arguments, [
{name: "value", type: String}
], false);
if (e) throw e;
return Number._parse(value, Sys.CultureInfo.CurrentCulture);
Hi CHPEmpl,
I'm just checking if you still need assistance with the matter.
Hello CHPEmpl,
I'm not able to tell what is causing this behavior. Could you provide me with a small sample reproducing the issue, so I can investigate it further? Also, here you can find a sample of batch updating - http://ko.infragistics.com/products/aspnet/sample/data-grid/batch-updating.
Thank you for your response,
I was able to resolve the Jscript error by setting the data types on the SQLparameter fields, but now the WebDataGrid will now show the updated results on the first postback after clicking the Save button. I have to click the button twice to see the updated results in the grid.
I tested your scenario with v11.2.20112.2055 but I could not reproduce the issue. So in order to be able to investigate this further, I would need a small isolated sample, demonstrating the behavior you have described. Thank you.