
- Go to your "Batch Editing" sample.
- Open up the datepicker calendar for one of the "Last supply" values.
- Close the calendar WITHOUT changing the date.
The cell is marked with the dirty indicator even though we didn't change the value. What can be done to avoid this?
Thanks in advance!
5 Answers, 1 is accepted
Unfortunately, this behavior is caused by different time zones. Check this screen-cast which shows what date is returned from the server in online demo and the date returned from local server. The problem is caused by the way how the JavaScriptSerializer to serializes the DateTime ( /Date(milliseconds)/ ). Thus the information for the time zones is lost and the date created on the client is with different hours.
What I can suggest you is to use server binding and editing.
Georgi Krustev
the Telerik team

Also, if we have a page that contains two grids (not master/detail) plus other fields that will have ALL its data saved with a single Save button, can we do server binding/editing on one and batch editing on the other?
The problem with the time zones is not related with the DatePicker UI component. The problem, as I mentioned, is related with Date object and JavaScriptSerializer itself. The safest way to overcome this issue is to use server editing.
Unfortunately, the logic which puts the "dirty" flag cannot be stopped only for a specific columns.
Different grids can have different way of binding/editing. One can have server binding/editing and other can have Ajax binding/editing. Please note that the grid with server binding/editing will cause the page to reload, so any changes made in the grid, which uses Ajax binding/editing will be lost if they are not saved before that.
Georgi Krustev
the Telerik team

function GridProducts_onSave(e) {
$(e.cell).find(".t-dirty").remove();
}
Thanks in advance!
You can achieve your goal with the following code snippet:
function
Grid_onSave(e) {
setTimeout(
function
() {
$(e.cell).find(
".t-dirty"
).remove();
});
}
Kind regards,
Georgi Krustev
the Telerik team