Hi,
My dates in the grid are being displayed one day behind even though I have set the EnableUtcDates(true).
I have enabled UTCDates in my grid model through the MVC GridModel() method like this :
GridModel GetGridModel(selectedRow) {
GridModel gridModel = new GridModel(); gridModel.ID = "MyGrid"; gridModel.AutoGenerateColumns = false; gridModel.PrimaryKey = selectedRow.PrimaryKey; gridModel.Width = "100%"; gridModel.Height = "400px"; gridModel.EnableUTCDates = true;
.... ....// other settings
..... ......
return gridModel;
}
1) The date I get from server is 7/1/2012 00:00:00.000 & the grid displays 6/30/2012 (Here the month & day both are decremented because of 1st date)
2) The date I get from server is 11/11/2014 00:00:00.000 & the grid displays 11/10/2014 (Here only the day is decremented)
---------------
This issue is also discussed here but the answer suggests to enable UTCDates feature of the grid.
http://ko.infragistics.com/community/forums/t/80982.aspx
I have enabled UtcDates, I am still facing the issue. What am I doing wrong?
Thanks.
Hi zep lin,
Thank you for posting in our forums!
I will need a little more time to investigate why the dates continue to be offset while EnableUTCDates is true. First, please answer the following questions for me so I may better assist you with this:
1.) Which version and build of IgniteUI you are using. e.g. 14.1.20141.2249
2.) How is the Date being passed into the grid? Are you sending it directly as JSON from the server?
Looking forward to hearing from you.
Thanks Michael for the response.
1) I am using 2013.2 version of infragistics. Version 4.13.2.2157
2) This method converts my collection to json and then passes it on to the grid:
public ActionResult ConvertToJson<T>(ResponseWrapper<T> result) { ResponsePacket<T> dataViewModel = new ResponsePacket<T>(); JsonResult jsonResult = new JsonResult(); var pageSize = HttpUtility.ParseQueryString(Request.Url.Query).Get("pageSize"); var pageIndex = HttpUtility.ParseQueryString(Request.Url.Query).Get("page"); if (pageSize == null || pageIndex == null) { dataViewModel.Records = result.Content; dataViewModel.RecordCountKey = result.recordCountKey; jsonResult.Data = dataViewModel.Records; jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet; } else { dataViewModel.Records = result.Content.AsQueryable(); dataViewModel.RecordCountKey = result.recordCountKey; jsonResult.Data = dataViewModel; jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet; } return jsonResult; }
The grid model is set up on my controller & the gridModel is generic in a way that it is for all the entities & the columns are set up dynamically like this :
gridModel.Columns.Add(new GridColumn() {
//record is my result set which contains the MetaData of the database table HeaderText = record.DisplayName, Key = record.ColumnName, DataType = record.DataType });