I need to update Grid after I update data in the database by calling
$('#ExchangeGrid').data('kendoGrid').dataSource.read();
I need to update grid with current DateTime but grid is updating with time that are present in DateTimePicker()
How can I change the time to current?
My Grid
@(Html.Kendo().Grid<Internal.Models.ExchangeRateData>()
.Name("ExchangeGrid")
.Columns(columns =>
{
columns.Bound(p => p.originCurrencyFormated);
columns.Bound(p => p.targetCurrencyFormated);
columns.Bound(p => p.rate);
columns.Bound(p => p.percentage) ;
columns.Command(commands => { commands.Edit(); });
columns.Bound(p => p.adjustedRate) ;
})
.Editable(edit =>
{
edit.Mode(GridEditMode.InLine);
})
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Model(model =>
{
model.Id(item => item.targetCurrency);
})
.Events(events =>
{
events.RequestEnd("onRequestEnd");
})
.Read(read => read.Action("ExchangeRate_Read", "MyController").Data("ReadRequestData"))
.Update(c => c.Action("Currencies_Update", "MyControllor"))
)
)
When I update Grid function "ReadRequestData" is called
.Read(read => read.Action("ExchangeRate_Read", "MyController").Data("ReadRequestData"))
In this function value of "date" is populated from DateTimePicker
function ReadRequestData() {
return {
"date": $('#dateList').val()
};
}
Code for DateTimePicker:
@(Html.Kendo().DateTimePicker()
.Name("dateList")
.Start(CalendarView.Month)
.Format("dddd MMMM dd, yyyy H:mm:ss")
.Value(DateTime.Now)
.Events(e => e.Change("changeDate"))
)
Code for function onRequestEnd(e)
function onRequestEnd(e) {
if (e.type == "update") {
$('#ExchangeGrid').data('kendoGrid').dataSource.read();
}
}
I need to update several columns after InLine Edit but automatically only column that have been change is updated. I also need to update the column that are calculated from the column that are changed.