I'm having problems using the 2005.1 CLR4.5 WebDataGrid with VS 2013. Cells will not retain the edited values when using RowEdit or the RowEdit Template. Also when using Batch Updating, a duplicate row is created after postback, I then receive a "Duplicate Key" error. Using SQL Sever Ole DB connection.
I've attempted many times to upload a test solution zip file to this forum but keep getting a 404 page error.
Please copy all responses to: fxferguson@chp.org
Thank you for any help you can provide
Hello CHPEmpl,
Thank you for contacting us.
Are you sure about the version, you mentioned 2005 with CLR4.5, I assume you meant 15.1, because CLR4.5 version requires 12.2 and later.
There are couple possibilities that could cause cells not to retain their values on edit, incorrect DataKeyFields configuration or some front end logic that is handling the editing. I will need a sample or code snippet in order to gain basic understanding of your application configuration. The duplicate row error also could be related to the DataKeyFields configuration. Could you verify that unique key identifier is used.
You can upload the sample on cloud storage like google drive, dropbox or any other, and share the link with me, or to send it to our support email - support@infragistics.com
I am looking forward to hearing from you.
Thank you for your reply. You are correct I did mean version 15.1. As for the DataKey fields set on grid. I am using the primary key from the database table. The project file along with the database files can be found from Google drive link:
https://drive.google.com/file/d/0B4nm4_C5BYr4WlVkU3pSeWFqWnM/view?usp=sharing
Thank you.
Thank you for the provided sample!
I've successfully managed to run it. Could you share with me the exact steps that I should take in order to reproduce the mentioned issue, and what is the expected result?
Looking forward to hearing from you.
When any of the cell values are edited(except for the key fiel), after clicking the Done button, a duplicate row displays. After clicking the save changes button, I receiv an Error message "duplicate key"
Apologies for the misspelling in my last reply. Here is the problem I'm experiencing:
After editing the cell values in "package Count" column of the 1st 2 rows of the grid = press "Done"(see image from URL).
https://drive.google.com/file/d/0B4nm4_C5BYr4b0FVTVkyTWNnV00/view?usp=sharing
After the clicking the "Save Changes" button, notice the 2 edited rows are duplicated and the changed values reverted back to their original values.
https://drive.google.com/file/d/0B4nm4_C5BYr4d2l4MzBiem1kdmc/view?usp=sharing
When selecting a new row the following error message is displayed:
https://drive.google.com/file/d/0B4nm4_C5BYr4cHBJcG5ZcFBNZ2M/view?usp=sharing
Hello,
About the thrown error, I've managed to reproduce it. It seems that we had a issue with version 15.1, which was fixed and no longer appear in the latest 16.2.20162.2013.
As for the values which are not persisted, this is because the column fields in the SQL Database are with different names than the defined parameter fields in the SqlDataSource. It is recommended to have the same name value, because the Grid wont be able to pass them automatically (when AutCrud is set to true).
Also both Stored Procedures are not set correctly, you should specify Incepture also. Keep in mind that "Job_Control_Number" parameter should be specified also, it is used in the update procedure.
Code snippet:
<asp:SqlDataSource ID="MailLog" runat="server" ConnectionString="<%$ ConnectionStrings:MailLog %>" ProviderName="<%$ ConnectionStrings:MailLog.ProviderName %>" SelectCommand="SELECT * FROM [Incepture].[tbl_EOB_Mail_Log2] ORDER BY [File_Generated_Date]" InsertCommand="[Incepture].[usp_ins_tbl_EOB_Mail_Log]" OldValuesParameterFormatString="original_{0}" UpdateCommand="[Incepture].[usp_upd_tbl_EOB_Mail_Log]" InsertCommandType="StoredProcedure" UpdateCommandType="StoredProcedure"> <InsertParameters> <asp:Parameter Name="Job_Control_Number" Type="String" /> <asp:Parameter Name="Package_Count" Type="Int32" /> <asp:Parameter Name="File_Generated_Date" Type="DateTime" /> <asp:Parameter Name="Job_Finish_Date" Type="DateTime" /> <asp:Parameter Name="SLA_Date" Type="DateTime" /> <asp:Parameter Name="Met_SLA" Type="Int32" /> <asp:Parameter Name="Missed_SLA" Type="Int32" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="Job_Control_Number" Type="String" /> <asp:Parameter Name="Package_Count" Type="Int32" /> <asp:Parameter Name="File_Generated_Date" Type="DateTime" /> <asp:Parameter Name="Job_Finish_Date" Type="DateTime" /> <asp:Parameter Name="SLA_Date" Type="DateTime" /> <asp:Parameter Name="Met_SLA" Type="Int32" /> <asp:Parameter Name="Missed_SLA" Type="Int32" /> </UpdateParameters></asp:SqlDataSource>
In general it is not recommended to define fields with "space", like "Job Control Number".
Thank you Zdravko,
Apologies for just being able to get back to you. I am upgrading to 16.1 now. I will also make the recommended changes then post my results. Again, thank you for your help.
I am looking forward to your reply. Let me know what is the result after the changes.