My users have been reporting since yesterday that dates they enter into the WebDataGrid are losing a day when saving to the database.
On closer inspection, these date/time fields are losing 1 hour. For example, if a user enters 11/7/2011 into the WebDataGrid, 11/6/2011 11:00PM will be stored to the database, and the users then sees 11/6/2011 displayed in the grid as his saved value. This occurs regardless of the EditorProvider used... This even happens if you use the TextBox provider.
And this began recently, oddly corresponding to Daylight Savings Time.
I have found a very clumsy workaround. If you change your SQL statement so that it converts DateTime fields to VarChars, the WebDataGrid won't corrupt the date.
I have opened a support ticket CAS-77072-NSTXZT, but have also posted the issue and the workaround here, for the benefit of other users.
I consider this issue to be critical, since it is corrupting data.
Thanks for the update Dave. I am very much looking forward to the SR, so that I can upgrade to 11.2 (can't wait for multi-column headers!). I learned a harsh lesson from installing 11.1 right after it was released. Always wait for the first SR.
Jorge, the untested build that IG provided (11.1.20111.2090) has been running bug-free in my production environment for a while. I have confidence in the build, and they even populated the CDN for the build. It's a good build that has the bug fixed.
I don't know if I'm breaking any rules by posting the download link, but the forums don't have a private messaging feature. Here's the link:
http://download.infragistics.com/Download/hotfixes/pre/!Special/NAASPNET_20111.2090.zip
Cheers, -Rob
Rob
I am using 11.1.20111.2064. I saw on this post that as of last week Infragistics is unsure if this is going to be in an SR or not, and I (like most of us) need to make it to meet our deadlines. I thought about upgrading to 11.2, but I really didn't want to throw any more wrenches into the mix since this piece is going into production in the next few days. The last thing I need is to trash my deve environment right now. Especially since I have not seen any post from "them" :) that the fix is included in 11.2.
I agree with your posts, that this is a HUGE problem for anyone editing date/times on the grid. I saw the bug by "accident" in some of my final testing, else it would have gone out and trashed alot of data. BTW, that last post where it captures the date string in javascript is the safest way reset the dates and times. The other way works if you just want the date (determining the offset time, and doing math to guess at the right value), and you don;t have to add a new field and muck up your datastores with these extra fields.
It would be nice to know when a version with the fix is going to be released, so I can plan accordingly.
I checked the bug (84041) and it should be included in the 11.2 release. The public SR should be shipping soon, too. Or contact Developer Support to get access to an untested build.
-Dave
Jorge, what version are you on?
Infragistics sent me an untested build of 11.1 that fixed the problem for me. But they sent it so close to the release of 11.2 that I wonder if 11.2 includes the fix. You aren't on 11.2 are you?
Installing 11.2 might be worth a try.
To deal with the time field alone, I added the following workaround:
I added a new string field to my datastore (DeliveryTimeControl), and added it as hidden to the grid. I then added the following to the aspx page / javascript and linke added the event to the grid. My DeliveryTime field is in index 10, and my DeliveryTimeControl is in index 15.
if (cell.get_index() != 10) return; var row = cell.get_row(); row.get_cell(15).set_value(cell.get_value());}
This saves a string version of the date/time field. Then in the code behind, I added the following (been up all night, so maybe it could be cleaner - feel free to offer it up):
var delTime = (DateTime)podMaster.DeliveryTime;var delTimeControl = podMaster.DeliveryTimeControl;var delTimeControlMarker = delTimeControl.LastIndexOf(":");int delTimeControlHour = -1;
if (delTimeControlMarker > 5){ var delTimeControlHourString = delTimeControl.Substring(delTimeControlMarker - 5, 2); var delTimeControlMinString = delTimeControl.Substring(delTimeControlMarker - 2, 2); delTimeControlHour = Convert.ToInt32(delTimeControlHourString);}
if (delTime.Hour != delTimeControlHour){ // The bug is here delTime = new DateTime(delTime.Year, delTime.Month, delTime.Day, delTimeControlHour, delTime.Minute, 0);}
So, you end up having to compare the value in your datastore against the text version of the date/time value generated in javascript (just the hour in this code). If it is different, it changes the datstore value to the text value.