This is a migrated thread and some comments may be shown as answers.

[Solved] AJAX Delete with Editor Template

1 Answer 164 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kevin
Top achievements
Rank 1
Kevin asked on 18 Apr 2011, 08:52 PM
I have a grid set up to bind immediately from the Model.  It also has methods for AJAX refresh, insert, update, and delete.  The type of object that the grid displays has an template defined in EditorTemplates.  I am using the mode PopUp for editing.  I can successfully get all of this to work.  However, the moment I try to add the DELETE command to the grid side-by-side with the EDIT command, ASP.NET throws the following exception when attempting to load the page:

Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.

I've confirmed that it is somehow connected to my editor template.  What is baffling to me, is that for whatever reason, a simple AJAX delete is causing it to be thrown.  Any ideas?  Is this a bug?

EDIT: This is now posted at Stack Overflow as well - Telerik MVC Grid AJAX Delete Results in Exception.

1 Answer, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 26 Apr 2011, 03:27 PM
I'm having a similar problem except I'm using server-side templates instead of client side and I get the error if I add any command columns whatsoever.  I'm curious to see if anyone has a solution to the problem.

Also note, Kevin posted his code to StackOverflow, if that helps.
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Share this question
or