Form collection, there's no data posted for this column.
Here's some Grid definition:
<%= Html.Telerik()
.Grid<RecipeIngredientModel>()
.Editable(editing=>editing.Enabled(true))
.Name("IngredientsList")
.DataKeys(keys => keys.Add(o => o.RecipeIngredientId).RouteKey("RecipeIngredientId"))
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("SelectAjaxIngredients", "Cookbook", new { recipeId = ViewData.Model.RecipeId })
.Insert("InsertAjaxIngredient", "Cookbook", new { recipeId = ViewData.Model.RecipeId })
.Update("UpdateAjaxIngredient", "Cookbook", new { recipeId = ViewData.Model.RecipeId })
.Delete("DeleteAjaxIngredient", "Cookbook", new { recipeId = ViewData.Model.RecipeId }))
.Columns(columns =>
{
columns.Bound(m => m.RecipeIngredientId).Hidden(true);
columns.Bound(m => m.Quantity).Width(90);
columns.Bound(m => m.Fraction).Width(90).ClientTemplate("<#= Fraction.FractionName #>").Title("Fraction");
columns.Bound(m => m.Unit).Width(115).ClientTemplate("<#= Unit.UnitName #>").Title("Unit");
columns.Bound(m => m.Ingredient).Width(200).ClientTemplate("<#= Ingredient.IngredientName #>").Title("Ingredient");
columns.Bound(m => m.Preparation).Width(250).Title("Preparation");
})
.Editable(editing => editing.Mode(GridEditMode.InLine))
.Selectable()
.ClientEvents(events =>
{
events.OnRowSelect("ingredients_onRowSelected");
events.OnLoad("ingredients_resetSelection");
events.OnDataBinding("ingredients_resetSelection");
events.OnDataBound("ingredients_resetSelection");
events.OnEdit("ingredients_onEdit");
})
.Footer(true)
%>
Here's some JavaScript code to trigger the update event:
and some code executed in the ingredients_onEdit method:
Here's the model:
And here's the \Views\Shared\EditorTemplates\Ingredient.ascx file:
Any help would be greatly appreciated!
All the best,
Richard.