When defining a DataSource within @(Html.Kendo().Grid(Model), I have successfully used
.DataSource( dataSource => .Ajax( ).Model( model => model.Id( m => m.PROPERTY ) ) )
where PROPERTY is a property of the object that is the model. What is the correct syntax for defining Model.Id if the Model is a System.Data.DataTable and the Id column in the DataTable is TableId?
In other words, model.Id( m => ??? ).
I have tried, model.Id( m => Model.PrimaryKey )
, which seems to satisfy the requirement that model.Id be set, but the Update Action (.Update(update => update.Action("MyUpdateMethod", "MyController")
) doesn't ever hit, so I think there must still be something wrong.
new kendo.data.DataSource({ schema: { model: { id: "PrimaryKey" } } });
if you wanted to convert to JS instead of MVC helper, the easiest thing to do is use the MVC helper once, view the page in your browser, and copy/paste the generated JS code. Then replace your MVC helper razor code with the generated JS. – CodingWithSpike