The igGrid column editor EditorType(ColumnEditorType.Date) with DataMode(DateEditorDataMode.Date) appears to load the cell editor with null when the column is clicked in .NET Core 2.0
(see attached screen snap)
This same code works correctly in ASP.NET 4.6.1 (the cell editor is loaded with “05:00”)
I’ve had such trouble with this forum editor, so have attached a link to the example zipped solution on one-drive instead:https://1drv.ms/u/s!Asqef4XMXF_I8QGw81kUwEPTTKpN
Environment:Visual Studio 15.5.5IgniteUI (17.2.456)Infragistics.Web.AspNetCore (22.214.171.124)
Thank you for posting in our community.
I am currently looking at this matter for you. I will get back to you until the end if the business day tomorrow, 2/22/2018, to update you with my findings.
Please feel free to continue sending updates to this case at any time.
Regards,Vasya KacheshmarovaAssociate Software DeveloperInfragistics
Thank you for your patience while I was looking into this matter for you.
I tried reproducing the described behavior in an isolated sample. I removed all the code that is not directly related to the grid configuration and I was not able to replicate the empty editor when edit mode is entered.
When I enter edit mode the value for the cell editor is correctly set to the cell value. I tested this under Chrome, Firefox and Edge latest versions with Infragistics.AspNetCore package version 126.96.36.199.
Here you will find my sample. Please test it on your side and let me know what is the result. If the issue is still reproducible can you please provide me steps to reproduce and any details that you consider relevant.
Looking forward to hearing from you.
Thank you for the screenshot.
I see you’re running the sample on IE.
IE doesn’t seem to like dates, whose years that start with 00, for example the date for the first cell is “0001-01-01T00:00:00Z" if you create a new Date objects from that:
new Date(new Date("0001-01-01T00:00:00Z"));
You’ll get Invalid Date in IE. Since the date is invalid, the editor disregards it.
Since the client-side date objects count the milliseconds since January 1, 1970, 00:00:00 that may be a good starting point for your server-side date objects instead of year 0001, for example:
StartTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(timeSecs);
That should work in all browsers.
Let me know if that solves your issue.
Thank you Maya!
That did it
Strange, I'd copied that code from another project (.NET 4.6.1) and it worked there
If I knew how to supply just the seconds in the controller (for the column editor), I wouldn't have to pass a date object...
I’m glad to hear that solved your issue.
If the value of your column does not need to go through the standard time zone conversions (should show the same for any user in any time zone) you could use a string type and put an mask editor on top of it so it matches the format you want to display it in. Otherwise you would still need to hold the data in date format to handle the different time zone scenarios.
By the way, we will be adding a TimePicker editor in the next release (for 18.1).
It should provide a nicer UI for editing time and also will allow filtering/sorting by time out of the box.
Let me know if you have any additional questions or concerns.
I cringed at that particular solution for entering time values using a date object - all that extra data being passed back and forth
Looking forward to the TimePicker column editor
I'm storing the time of day as an int (seconds) in the databaseI'll take some time to look into using a mask editor to parse out the HH:MM
Thanks again for your help!
I see. In that case the mask editor might not work for you since it cannot do more complex conversions on the value. Assuming the grid holds the numeric value that represents the seconds ( for example: 75) that numeric value needs to be converted to hours and minutes when it’s passed to the editor (should become 1 minute and 15 seconds, which in the HH:MM format should be displayed as 00:01 ) and then converted back to seconds when you pass it back to the grid (for example if a user edits it to 00:02 – becomes 2 minutes, should pass 120 seconds as a result from updating to the grid, the new value of the cell should be 120).
You could create a custom editor provider, that extends the mask editor, where you can specify your own getValue/setValue method and do the conversions there. The custom editor provider can be set via the editorProvider option in the column settings:
We have a sample in our samples browser with a custom editor provider you could refer to as well if you decide to go this route:
Hope this helps.