This question is locked. New answers and comments are not allowed.
Hi,
I've got a problem with ajax binding and updating the model which has properties annotated as non-editable. I've checked the http request on the client side and it not contains properties marked as non-editable.
EDIT:
The same effect is when I remove editable attribute and call a .ReadOnly() method on that column.
I'd by thankful for any advice.
(ver. 2011.1.414.340)
Here's my view snippet and controler's code:
I've got a problem with ajax binding and updating the model which has properties annotated as non-editable. I've checked the http request on the client side and it not contains properties marked as non-editable.
EDIT:
The same effect is when I remove editable attribute and call a .ReadOnly() method on that column.
I'd by thankful for any advice.
(ver. 2011.1.414.340)
Here's my view snippet and controler's code:
<p> <%= Html.Telerik().Grid<MvcApplication1.Controllers.HomeController.DataContainer>() .Name("Grid") .DataKeys(keys => { keys.Add(p => p.Id); }) .DataBinding(dataBinding => { dataBinding.Ajax() .Select("_Select", "Home") .Update("_Update", "Home"); }) .Columns(columns => { columns.Bound(p => p.TextData).Width(130); columns.Bound(p => p.NonEditableData).Width(130); columns.Command(commands => { commands.Edit(); }).Width(180).Title("Commands"); }) .Editable(editing => editing.Mode(Telerik.Web.Mvc.UI.GridEditMode.InLine)) .Pageable() .Scrollable() .Sortable()%> </p>public class DataContainer{ public string TextData { get; set; } [Editable(false)] public string NonEditableData { get; set; } [ScaffoldColumn(true)] public int Id { get; set; }}[GridAction]public ActionResult _Select(){ return View(new GridModel(GenerateData()));}[GridAction]public ActionResult _Update(){ var data = new DataContainer(); if(TryUpdateModel(data)) { // here the model.NonEditableData is null return View(); } return View();}public IEnumerable<DataContainer> GenerateData(){ return from n in Enumerable.Range(1, 100) select new DataContainer() { TextData = n.ToString(), NonEditableData = n.ToString(), Id = n };}