0

I need to visually update a DateTime column in the selected grid row when a different column is edited. However, the data in the grid must remain dirty (before datasource sync).

Currently the "Months" column has an int value and when it changes, I'm picking up the event and processing a new value for the "End_Date" column. I do this by finding the "SelectedItem" and setting a value to the column (eg. SelectedItem.End_Date = new value)


The update works fine, except that in order for the new End_Date value to show, I'm having to sync the datasource of the grid. I don't want to do that. The grid data needs to remain unsaved (dirty). (we have a save button that should do the saving)

In other words, this "Months" value, once changed, should reflect a new "End_Date" in the End_Date column immediately without having to sync the datasource.

I imagine I need to find the DatePicker widget in the current selected row and do something to it to get the updated date to show up. I don't know how to do that.


(The editor in the Kendo Grid for the DateTime value is set to Kendo.DatePicker)

Thank you for your help, Chad.

Chad Lehman
  • 902
  • 7
  • 10

1 Answers1

0

Turns out I was setting the value incorrectly (both examples in javascript).

selectedItem.End_Date = kendo.parseDate(data, "MM/dd/yyyy")

Should have been:

selectedItem.set("End_Date", kendo.parseDate(data, "MM/dd/yyyy"))

If done the previous way, the underlying value does change, but it doesn't show up in the UI immediately.

I expected this method to work, because this is how .NET languages work (property setters). The kendo extensions work by their own convention, apparently.

Using the second method, it works as expected.

Chad.

Chad Lehman
  • 902
  • 7
  • 10