This question is locked. New answers and comments are not allowed.
Hi,
When using the telerik asp mvc grid with DataTime field from the Model
I've encountered a very strange behaviour of the DataTime column:
it cannot show the time between 00:00 and 00:59. When the value
of the DataTime field is within this range it is shown in the grid as 01:00
View:
Model:
In action I can see that the value entered was correct, it is sent to the database
and stored but still the grid displays the incorrect value from the range mentioned.
Is that a problem with incorrect format provided in the View or am I missing something obvious?
Thanks in advance for any hints
Best regards,
M
When using the telerik asp mvc grid with DataTime field from the Model
I've encountered a very strange behaviour of the DataTime column:
it cannot show the time between 00:00 and 00:59. When the value
of the DataTime field is within this range it is shown in the grid as 01:00
View:
@(Html.Telerik().Grid<DirectionsDepartureViewModel>() .Name("DirectionsDepartureTimeGrid") .DataKeys(keys => { keys.Add(m => m.Id); }) .DataBinding(dataBinding => { dataBinding.Ajax() .Select(MVC.DirectionsDepartureTime.List()) .Update(MVC.DirectionsDepartureTime.Edit()); }) .Columns(columns => { columns.Bound(m => m.Name).ReadOnly(true); columns.Bound(m => m.DepartureTime) .EditorTemplateName("Time") .Format("{0:HH:mm}"); columns.Command(commands => { commands.Edit(); }).Title("Commands"); }) .Editable(editing => editing.Mode(GridEditMode.InLine)) .Pageable() .Scrollable() .Sortable() .Groupable(grouping => grouping.Groups(groups => { groups.Add(c => c.PrintingHouseName); })) .Filterable() .ClientErrorHandling() )Model:
public class DirectionsDepartureViewModel { [ScaffoldColumn(false)] public int Id { get; set; } [Display(Name = "Direction's name")] public string Name { get; set; } [Display(Name = "Departure")] [DataType(DataType.Time)] [DisplayFormat(NullDisplayText = "")] public DateTime? DepartureTime { get; set; } public string FormattedTime { get; set; }}In action I can see that the value entered was correct, it is sent to the database
and stored but still the grid displays the incorrect value from the range mentioned.
Is that a problem with incorrect format provided in the View or am I missing something obvious?
Thanks in advance for any hints
Best regards,
M