Please refer to the screen cast link below. During inline editing when the time column is clicked to begin editing the existing time is cleared. Also after the time and then entering the am pm designator the time is cleared and the editor closes. Entering a time is actually only possible when the DateTime model property is marked as nullable otherwise a validation error is thrown. (All in the video)
Grid:
@(Html.Kendo().Grid<Aero.Models.Leg>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.FlightID);
columns.Bound(p => p.Origin);
columns.Bound(p => p.Destination);
columns.Bound(p => p.Start);
columns.Bound(p => p.TakeOff);
columns.Bound(p => p.Landing);
columns.Bound(p => p.Stop);
})
.ToolBar(toolBar =>
{
toolBar.Save();
toolBar.Create();
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Scrollable()
.Resizable(resize => resize.Columns(true))
.HtmlAttributes(new { style = "height:430px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize(20)
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.LegID);
model.Field(p => p.LegID).Editable(false);
})
.Read(read => read.Action("Legs_Read", "Test", new { id = Model.FlightID }))
.Update(update => update.Action("Legs_Update", "Test"))
//.Create(create => create.Action("ForeignKeyColumn_Create", "Grid"))
//.Destroy(destroy => destroy.Action("ForeignKeyColumn_Destroy", "Grid"))
).Deferred()
)
Model:
public class Leg
{
public int LegID { get; set; }
[DataType(DataType.Time)]
public DateTime? Start { get; set; }
[DataType(DataType.Time)]
public DateTime? Stop { get; set; }
[DataType(DataType.Time)]
public DateTime TakeOff { get; set; }
[DataType(DataType.Time)]
public DateTime Landing { get; set; }
public string Origin { get; set; }
public string Destination { get; set; }
public string Notes { get; set; }
[Display(Name = "Flight")]
public int? FlightID { get; set; }
public virtual Flight Flight { get; set; }
}
https://screencast-o-matic.com/watch/cbiQc1lbrz