To distinguish between new and existing models, the data source checks if the item id
has the default value for its type - for example a model with numeric id
and a value of 0
will be considered as new.
So anytime there is a change in a model, if it has no id/ id with default value, the grid data source will send it to the Create operation. If the model has an id
, this means it is an existing item, so it will send it to the Update operation.
So in the context of plain MVC, to edit a model, you would need it to have an Id
, otherwise how would you know from the database, which model is needed to pass to the view?
In case you had something else in mind that I have misunderstood, please elaborate.
Get quickly onboarded and successful
with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.