This question is locked. New answers and comments are not allowed.
Greetings, all. I just started using the MVC Extensions and I have to say, I'm very impressed (mostly because they're free!). But I'm having a hard time getting inline editing working correctly, and I wonder if I'm missing something. I have a very simple grid (two fields) where I would like the user to be able to edit one of the fields. I've got the databinding working correctly, but the Edit button does not seem to be finding my controller method. Here is the relevant code.
My grid declaration:
My controller action method:
However, whenever I click the "Edit" button, I do not hit my controller method. Instead I get some odd URL that ends with: 1?ProductCustomFields-mode=edit
Am I missing something or doing something wrong? I literally just started working with these controls no more than 2 hours ago, and I'm impressed with how much I've been able to implement in so little time. But I'm following the help documentation to the letter, so I must be missing something.
Any help would be appreciated. Thanks in advance.
My grid declaration:
@Html.Telerik().Grid(Model.ProductCustomFields) .Name("ProductCustomFields") .DataKeys(dataKeys => dataKeys.Add(c => c.FieldId)) .DataBinding(dataBinding => dataBinding .Ajax().Update("_UpdateProductCustomField", "Product", new { area = "Admin" }) .Delete("_DeleteProductCustomField", "Product", new { area = "Admin" })) .Columns(columns => { columns.Bound(o => o.FieldName).Title("Name").ReadOnly(); columns.Bound(o => o.FieldValue).Title("Value"); columns.Command(commands => { commands.Edit(); commands.Delete(); }); }).Footer(false)My controller action method:
[HttpPost][GridAction]public ActionResult _UpdateProductCustomField(int fieldId){ var pcfs = Session["ProductCustomFields"] as List<ProductCustomFieldViewModel>; var pcf = pcfs.Where(c => c.FieldId == fieldId); TryUpdateModel(pcf); return View(new GridModel(pcfs));}However, whenever I click the "Edit" button, I do not hit my controller method. Instead I get some odd URL that ends with: 1?ProductCustomFields-mode=edit
Am I missing something or doing something wrong? I literally just started working with these controls no more than 2 hours ago, and I'm impressed with how much I've been able to implement in so little time. But I'm following the help documentation to the letter, so I must be missing something.
Any help would be appreciated. Thanks in advance.