<div>
<ejs-grid id="Grid" actionBegin="begin" toolbar="@(new List<string>() {"Delete" ,"Add", "Update", "Cancel" })" allowPaging="true">
<e-grid-editsettings allowDeleting="true" allowEditing="true" allowAdding="true"></e-grid-editsettings>
<e-grid-columns>
. . . . .
<e-grid-column field="DateStart" headerText="OrderDate" type="dateTime" edit="@(new {create = "created", read = "readd", destroy = "destroyd", write = "writed"})" minWidth="20" maxWidth="500"></e-grid-column>
</e-grid-columns>
</ejs-grid>
</div>
<script>
function begin(args) {
if (args.requestType === 'save') {
// you can also convert date object as ISO string using below method to resolve the problem.
args.data['DateStart'] = ej.data.DataUtil.dateParse.addSelfOffset(new Date(args.data['DateStart'])).toISOString();
}
} |