I would like to add DateTimePicker into row dynamically while adding new row on the clicking event. Also While doing so previous data gets cleared.
Here is code below:
@(Html.Kendo().Grid(Model.InOutTimes)
.Name("InOutTimesGrid")
.Columns(columns =>
{
columns.Bound(c => c.ID).Hidden();
columns.Bound(c => c.NoteID).Hidden();
columns.Bound(c => c.InDateTime).ClientTemplate(Html.Kendo().DateTimePicker()
.Name("InDateTime")
.Min(new System.DateTime(1970, 1, 1, 0, 0, 0)) // Epoch
.Format("MM-dd-yyyy HH:mm")
.TimeFormat("HH:mm")
.ToClientTemplate().ToString()
);
columns.Bound(c => c.OutDateTime).ClientTemplate(Html.Kendo().DateTimePicker()
.Name("OutDateTime")
.Min(new System.DateTime(1970, 1, 1, 0, 0, 0)) // Epoch
.Format("MM-dd-yyyy HH:mm")
.TimeFormat("HH:mm")
.ToClientTemplate().ToString()
);
})
.DataSource(datasource => datasource.Ajax().Read("InOutTimes_Read", "ClientNotesVirtual"))
Am I missing something. Please help!!.