This question is locked. New answers and comments are not allowed.
In spite of my success in getting validation to work in an ajax bound gridview earlier I find that it does not work correctly (in fact at all) in a detailview in a grid view. I've taken a simple "person with notes" test case
Person is validated correctly, but Notes are not. Note [DisplayName] is honored, but the validation is not. I can see that TryUpdateModel adds errors to the modelstate when I update a note, however, I don't believe the ajax callback should even have fired if validation was working correctly.
Help!
Andrew
<%= Html.Telerik().Grid<TelTest.Models.Person>() .Name("Grid") .DataKeys(k => { k.Add(p => p.Id); }) .DataBinding(db=> { db.Ajax() .Select("_selectAjax","Home") .Update("_updateAjax","Home"); }) .Columns(col=>{ col.Bound(p=>p.FirstName); col.Bound(p=>p.Surname); col.Command(com => { com.Edit(); }); }) .DetailView(dv => dv.ClientTemplate( Html.Telerik().Grid<TelTest.Models.Note>() .Name("GUESTS_<#=Id #>") .DataKeys(k => k.Add(c => c.Id)) .DataBinding(db => db.Ajax().Select("_AjaxNoteIndex", "Home", new { id = "<#= Id #>" }).Update("_AjaxNoteUpdateIndex", "Home").Insert("_AjaxNoteInsertIndex", "Home", new { id = "<#= Id #>" })) .Editable(f => f.Enabled(true)) .ToolBar(commands => commands.Insert().ImageHtmlAttributes(new { style = "margin-left:0" })) .Columns(c => { c.Bound(n => n.Textnote).Width(220); c.Command(com => { com.Edit(); }); }) .ToHtmlString() )) .Editable(ed=>ed.Mode(GridEditMode.InLine)) %>Person is validated correctly, but Notes are not. Note [DisplayName] is honored, but the validation is not. I can see that TryUpdateModel adds errors to the modelstate when I update a note, however, I don't believe the ajax callback should even have fired if validation was working correctly.
Help!
Andrew