I have WebDataGrid which needs to be update /Refresh while Change Value from Upper Portion of the Page. I have Some Bounded Fields and one ids the UnBounded Field. SomeTiimes it Works Fine but Sometine it Give me Error 'Value of an unBound Checkbox Field must be of Type of Bool'. I Have Set the Default Value but Getting the Same Error. My Front End Side Is :
<td align="center"> <igtbl:WebDataGrid ID="grdPay" runat="server" Height="400px" TabIndex="4" DataKeyFields="PARTICIPANT_ID" StyleSetName="Office2007Blue" EnableDataViewState="true" ViewStateMode="Enabled" BorderColor="#000066" BorderStyle="Ridge" AutoGenerateColumns="False" Width="780px"> <Columns> <igtbl:UnboundCheckBoxField Key="All_Checkbox" VisibleIndex="0" Header-Text="" HeaderChecked="true" Width="20px"> </igtbl:UnboundCheckBoxField> <igtbl:BoundDataField DataFieldName="TRANSACTION_DATE" Key="TRANSACTION_DATE" Hidden="True" DataType="System.DateTime" Width="120px" VisibleIndex="1"> <Header Text="Transaction Date" /> </igtbl:BoundDataField> <igtbl:BoundDataField DataFieldName="PARTICIPANT_CODE" Key="PARTICIPANT_CODE" DataType="System.DateTime" Width="120px" VisibleIndex="2"> <Header Text="Participant" /> </igtbl:BoundDataField> <igtbl:BoundDataField DataFieldName="BANK_NAME" Key="BANK_NAME" DataType="System.DateTime" Width="60px" VisibleIndex="3"> <Header Text="Bank Name" /> </igtbl:BoundDataField> <igtbl:BoundDataField DataFieldName="BANK_CODE" Key="BANK_CODE" DataType="System.DateTime" Width="60px" VisibleIndex="4"> <Header Text="Bank Code" /> </igtbl:BoundDataField> <igtbl:BoundDataField DataFieldName="BRANCH_NAME" Key="BRANCH_NAME" DataType="System.DateTime" Width="100px" VisibleIndex="5"> <Header Text="Branch Name" /> </igtbl:BoundDataField> <igtbl:BoundDataField DataFieldName="STATUS" DataType="System.String" VisibleIndex="6" Key="STATUS" Width="50px"> <Header Text="Status" > </Header> </igtbl:BoundDataField> <igtbl:BoundDataField DataFieldName="AMOUNT" Key="AMOUNT" DataFormatString="{0:N4}" DataType="System.Decimal" Width="80px" VisibleIndex="7"> <Header Text="Amount" /> </igtbl:BoundDataField> <igtbl:BoundCheckBoxField DataFieldName="Manually_Settle" DataType="System.Boolean" VisibleIndex="8" Key="Manually_Settle" Width="80px"> <Header Text="Manually Settle" > </Header> </igtbl:BoundCheckBoxField> <igtbl:BoundCheckBoxField DataFieldName="POST" DataType="System.Boolean" Width="50px" VisibleIndex="9" Key="POST" > <Header Text="Post" > </Header> </igtbl:BoundCheckBoxField>
<igtbl:BoundDataField DataFieldName="COUPON_PAYMENT_DATE" Key="COUPON_PAYMENT_DATE" VisibleIndex="10" DataType="System.DateTime" Width="100px" Hidden="true" > <Header Text="COUPON PAYMENT DATE" /> </igtbl:BoundDataField> <igtbl:BoundDataField DataFieldName="BANK_ID" Key="BANK_ID" VisibleIndex="11" DataType="System.DateTime" Width="100px" Hidden="true" > <Header Text="BANK ID" /> </igtbl:BoundDataField> <igtbl:BoundDataField DataFieldName="BRANCH_ID" Key="BRANCH_ID" VisibleIndex="12" DataType="System.DateTime" Width="100px" Hidden="true" > <Header Text="BRANCH ID" /> </igtbl:BoundDataField>
<igtbl:BoundDataField DataFieldName="PARTICIPANT_ID" Key="PARTICIPANT_ID" Hidden="True" DataType="System.String" Width="120px" VisibleIndex="13"> <Header Text="PARTICIPANT ID" /> </igtbl:BoundDataField> </Columns> <Behaviors> <igtbl:EditingCore> <Behaviors> <igtbl:CellEditing> <ColumnSettings> <igtbl:EditingColumnSetting ColumnKey="AMOUNT" ReadOnly="true" /> <igtbl:EditingColumnSetting ColumnKey="BANK_NAME" ReadOnly="true" /> <igtbl:EditingColumnSetting ColumnKey="BANK_CODE" ReadOnly="true" /> <igtbl:EditingColumnSetting ColumnKey="BRANCH_NAME" ReadOnly="true" /> <igtbl:EditingColumnSetting ColumnKey="STATUS" ReadOnly="false" /> <igtbl:EditingColumnSetting ColumnKey="POST" ReadOnly="false" /> <igtbl:EditingColumnSetting ColumnKey="TRANSACTION_DATE" ReadOnly="True" /> <igtbl:EditingColumnSetting ColumnKey="PARTICIPANT_CODE" ReadOnly="True" /> <igtbl:EditingColumnSetting ColumnKey="NAME" ReadOnly="True" /> <igtbl:EditingColumnSetting ColumnKey="SETTLEMENT_DATE" ReadOnly="True" /> <igtbl:EditingColumnSetting ColumnKey="CLEARING_ID" ReadOnly="True" /> </ColumnSettings> </igtbl:CellEditing> </Behaviors> </igtbl:EditingCore> <igtbl:RowSelectors> </igtbl:RowSelectors> </Behaviors> </igtbl:WebDataGrid> </td> <td> </td> </tr>
and BackEnd Side Code :
public void DataBindGrid() { Decimal TotalPayments = 0; DataTable DT = new DataTable(); DataTable DT2 = new DataTable(); bool IsallChecked = true;
DT = LoadData(); //grdPay.DataSource = DT; //grdPay.DataBind(); DT2.Columns.Add("All_Checkbox"); DT2.Columns.Add("PARTICIPANT_ID"); DT2.Columns.Add("TRANSACTION_DATE"); DT2.Columns.Add("PARTICIPANT_CODE"); DT2.Columns.Add("BANK_NAME"); DT2.Columns.Add("BANK_CODE"); DT2.Columns.Add("BRANCH_NAME"); // DT2.Columns.Add("NAME"); DT2.Columns.Add("AMOUNT"); DT2.Columns.Add("STATUS"); DT2.Columns.Add("Manually_Settle"); DT2.Columns.Add("POST"); DT2.Columns.Add("COUPON_PAYMENT_DATE"); DT2.Columns.Add("BANK_ID"); DT2.Columns.Add("BRANCH_ID");
if (DT != null) { grdPay.Rows.Clear(); for (int i = 0; i < DT.Rows.Count; i++) {
//grdPay.Rows.add(); var row = DT2.NewRow(); row["All_Checkbox"] = true; row["TRANSACTION_DATE"] = null; row["PARTICIPANT_ID"] = Convert.ToInt32(DT.Rows[i]["PARTICIPANT_ID"]); row["PARTICIPANT_CODE"] = Convert.ToString(DT.Rows[i]["PARTICIPANT_CODE"]); row["BANK_NAME"] = Convert.ToString(DT.Rows[i]["BANK_NAME"]); row["BANK_CODE"] = Convert.ToString(DT.Rows[i]["BANK_CODE"]); row["BRANCH_NAME"] = Convert.ToString(DT.Rows[i]["BRANCH_NAME"]); row["STATUS"] = Convert.ToString(DT.Rows[i]["STATUS"]); TotalPayments += chkDigit * Convert.ToDecimal(DT.Rows[i]["AMOUNT"]); if (!Convert.IsDBNull(DT.Rows[i]["IS_MANUAL"])) { row["Manually_Settle"] = (Convert.ToInt32(DT.Rows[i]["IS_MANUAL"])) == 0 ? false : true; } else { row["Manually_Settle"] = false; }
row["BANK_ID"] = Convert.ToInt32(DT.Rows[i]["BANK_ID"]); row["BRANCH_ID"] = Convert.ToInt32(DT.Rows[i]["BRANCH_ID"]); DT2.Rows.Add(row); DT2.AcceptChanges(); } txtDuePayment.Value = TotalPayments;
grdPay.DataSource = DT2; grdPay.DataBind(); } else { grdPay.DataSource = null; grdPay.DataBind(); }
if (IsallChecked == true && RadioButtonList1.SelectedValue == "S") chkAllStatus.Checked = true; }
Hello,
Thank you for posting in our community.
I have created and attached a small running sample based on the provided code snippet, and I could not reproduce the issue. On my side, the WebDataGrid works as expected. Note that I have commented out some of the code where the IDE throws errors.
Please test the sample on your side and let me know how it behaves. If the sample is not working as per your expectation, please modify it so that it replicates the behavior and send it back to me for further investigation.
Looking forward to hearing from you.
0118.Sample.zip
This issue cause when i select date from Infragistics WebDropDown list and click on Load button to load records of that date,this issue not generates on 1st attempt but when I randomly select date and click on Load button and repeat this process for multiple times,at random time this issue generates otherwise it works fine
In order to be able to investigate your issue further I would need a small isolated sample, reproducing the behavior you are experiencing. Please remove any external dependencies and code that is not directly related to these issues and attach the zipped sample in this forum thread.
Having a working sample on my side, which I can debug, will help me investigate this further and find the root cause of this behavior.