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

Add New / Update rows in grid broken with latest release

4 Answers 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
BRAD
Top achievements
Rank 1
BRAD asked on 20 Dec 2012, 12:40 AM
Have several different grids in my web site with add/update functionality, and they worked fine with kendo mvc version 2012.2.1002.  Since then, i have tried upgrading to 2012.3.1114, 2012.3.1121, and 2012.3.1210.  All work in most ways EXCEPT for add/update.  The 'update' function works fine if the objects populating the grid is not complicated.  A list of strings or something.  It seems like if the class is more complicated, in my case it inherits from an abstract class, and i get the following error every time i try to update a row via the
ds.Ajax().ServerOperation.Update:
Cannot create an abstract class. Type = System.MissingMethodException

Additionally, the 'add' functionality has also broken
 If i try this with a simple call, works great.  If i try this with something like:
ds.Ajax().ServerOperation.Create(create => create.Action("_AddDetail""SituationBoard"new { area = "Tools", id = @Model.ProjectGUID, 
SitBoardGUID= @Model.SitBoardGUID}));

My 'SitBoardGUID' value never gets passed to the controller (appears as null).  This line seems to translate to the following html:
<a class="k-button k-button-icontext k-grid-add" 
href="/CoBRAMVCPortal/Tools/SituationBoard/_GetDetailList/00000000-0000-0000-0000-000000000000
?SitBoardGuid=f2135c76-9769-4536-92ea-37c352ebf431
&amp;f2135c76-9769-4536-92ea-37c352ebf431_grid-mode=insert">

notice the SitBoardGUID value is entered twice, separated by a &amp; for some reason. That seems to be
causing the issue. Any guidance on when this will be fixed? It's somewhat worrisome that you've had 3 releases
and this is broken in all 3 of them.
Remember, all of these functions still work if i revert back to the 2012.2.1002 build.

4 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 24 Dec 2012, 08:30 AM
Hello Brad,

I am afraid that Grid with editing does not support binding to abstract model even with the previous version of the wrappers. Basically to create editor templates for the model, the Grid should create one dummy object of that model type - you see that with the attached project which uses version 710.
 
Regarding the Route parameters added for the create action, since we cannot check the exact setup we will need project to run an observe the exact scenario. You can use the sample project I attached to apply your changes and send it so we can take a look.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
BRAD
Top achievements
Rank 1
answered on 25 Dec 2012, 02:47 AM

You misunderstood my first question.  I'm not trying to bind to an abstract model, i'm binding to a model that inherits from an abstract model.  I will look into creating an example for you.

For the 'insert' issue though, i can create that easily enough.   I have the page redirect to a different section, and i have it pointing to your 12/10 kendo version.  If you click on 'add' for the detail, i can see in firebug this error:
The parameters dictionary contains a null entry for parameter 'SituationBoardCategoryGuid' of non-nullable type 'System.Guid' for method 'System.Web.Mvc.ActionResult _AddDetail(Kendo.Mvc.UI.DataSourceRequest, CoBRAMVC4Portal.Areas.Tools.Models.SituationBoardDetail, System.Guid, System.Guid)' in 'CoBRAMVC4Portal.Areas.Tools.Controllers.SituationBoardController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Even though the POST url is http://localhost:47270/Tools/SituationBoard/_AddDetail/582098f7-53b8-486d-9efb-3914c1a201bf?SituationBoardCategoryGuid=01a04c2b-d60c-4867-bbb1-705188513b2f .

This is easily reproducible with changes that I have made to your example.  If you switch the kendo version to your 710 version, you'll see no issue at all with the same code.  I can't, however, attach this code to this issue.  You allow me to attach 2MB max of file size to these issues, and your example alone was already 10MB.  Can I send this to an e-mail of yours instead?

0
Petur Subev
Telerik team
answered on 26 Dec 2012, 07:47 AM
Hello Brad,

I would like to ask you to open support ticket to attach the project there(and any information that you think would be helpful) and we can continue our conversation there.

Thank you in advance.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kelso
Top achievements
Rank 1
answered on 17 Mar 2015, 07:47 PM
You know this is getting more and more common, you let your users find your issues, and then try and move them to a private discussion, or ticket rather than to provide a an answer or solution, or even admit there is a bug. This thread will now sit out here without a resolution and waste everyone's looking at it without an answer. And he is right by the way, but the way around it depending on if it is not a child template would be to use:

columns.bound(model => model.ProjectionGUID).ClientTemplate("<a class='k-button k-button-icontext k-grid-add' href=" ' + Url.Action("ControllerAction", "Area", "Controller", new {id = @Model.ProjectionGrid, SitBoardGUID = @Model.SitBoardGUID}) /a>"

From the column itself rather than from the serverOperation. 

I know this might not be an option since I cannot see the code you are working with, but this will work, in a generic sense.
Tags
Grid
Asked by
BRAD
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
BRAD
Top achievements
Rank 1
Kelso
Top achievements
Rank 1
Share this question
or