This question is locked. New answers and comments are not allowed.
I've spent the past few hours unsuccessfully trying to get the TimePicker working as an inline editor inside an Ajax Grid (i.e. using Ajax databinding).
I'm attaching a complete repro but the important part is basically this:
If I feed the grid some data (let's say I use today's date - 7/22/2011 - and a time of 03:30:00), it displays the times correctly - so I know it has the correct values - but if I go into edit mode, both of the time pickers are wrong:
Is this something I'm doing wrong, or is it a bug in the Telerik MVC grid? If I just put a TimePickerFor directly on the page (no grid/ajax), it always has the correct value for both DateTime and TimeSpan. Inside an Ajax grid, it doesn't seem to behave properly.
If it's a bug, would there be any way to work around the issue in the meantime?
Thanks,
Aaron
I'm attaching a complete repro but the important part is basically this:
public class TimeContainer{ public int Id { get; set; } [UIHint("Time")] public DateTime TimeAsDate { get; set; } [UIHint("TimeSpan")] public TimeSpan TimeAsTimeSpan { get; set; }}@(Html.Telerik().Grid<TelerikMvcGridTimePickerExample.Models.TimeContainer>() .Name("Grid") .Columns(columns => { columns.Bound(m => m.Id); columns.Bound(m => m.TimeAsDate) .ClientTemplate("<#=TimeAsDate.toString(\"HH:mm:ss\")#>"); ; columns.Bound(m => m.TimeAsTimeSpan) .ClientTemplate("<#=TimeAsTimeSpan.Hours + ':' + TimeAsTimeSpan.Minutes + ':' + TimeAsTimeSpan.Seconds#>"); columns.Command(cmd => cmd.Edit()); }) .DataBinding(binding => binding.Ajax() .Select("_Data", "Home") .Update("_Update", "Home")) .DataKeys(keys => keys.Add(m => m.Id)) .Editable(editing => editing.Mode(GridEditMode.InLine)) .Sortable() .Filterable())If I feed the grid some data (let's say I use today's date - 7/22/2011 - and a time of 03:30:00), it displays the times correctly - so I know it has the correct values - but if I go into edit mode, both of the time pickers are wrong:
- The one based on the DateTime value goes to 7:00 AM instead of 3:30 AM; it is clearly not using an actual JS date and instead trying to parse out the full string value, because the "7" is the start of the date string. I even tried setting my system clock ahead 1 month, and it changed from 7:00 AM to 8:00 AM, as expected.
- The one based on the TimeSpan value is always 00:00.
Is this something I'm doing wrong, or is it a bug in the Telerik MVC grid? If I just put a TimePickerFor directly on the page (no grid/ajax), it always has the correct value for both DateTime and TimeSpan. Inside an Ajax grid, it doesn't seem to behave properly.
If it's a bug, would there be any way to work around the issue in the meantime?
Thanks,
Aaron