This is a migrated thread and some comments may be shown as answers.

[Solved] Inline Grid edit not recognizing an erased Date value as a modification

1 Answer 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Christopher Ronak
Top achievements
Rank 1
Christopher Ronak asked on 26 Apr 2012, 05:51 PM
Hi,

I'm using the inline edit mode to modify the contents of a grid. All is working great except that there doesn't seem to be a way to erase a date value once it's been entered. Here's some detail on the workflow:
  • Enter a date value in a DateTime field in the grid using the date picker
  • Click on SubmitChanges and it saves fine
  • Go back to that same date value and erase it by deleting the text. Hit enter.
  • In the OnSave event, it doesn't register as having been edited, so doesn't get saved on a SubmitChanges call

Thanks for any help

Chris

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 02 May 2012, 10:00 AM
Hi Chris,

This behavior is expected if you are using InCell editing. The Grid won't set the value if the current value is a date and the new value is not a valid one. You can avoid this by using the OnSave client-side event to modify the current value not to be date and different than null e.g.
function onSave(e) {
    if (e.values.TheDateMemberName === null) {
        e.dataItem.TheDateMemberName = '';
    }      
}



Kind regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Grid
Asked by
Christopher Ronak
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or