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

Grid Data Update/Delete

3 Answers 289 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Allan
Top achievements
Rank 1
Allan asked on 09 Nov 2015, 02:33 PM

I am in need of some help, I'm building a web application that uses the KendoUI, specifically the grid to display data.  I've used the entity framework under a "database first" scenario, this means that the models are created for me for all the tables in my database.  I'm displaying this data in the Kendo grid but I can't edit or delete any of the entries (inline with ajax).  If you delete an item it returns when you regresh the screen and the update button does nothing.  I suspect this is because we have no functions to handle these events.

Is there anyway I can utilise the already created scaffolded controller to do this as it already as an edit and delete function in it.

 Any help would be appreciated.

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 11 Nov 2015, 08:45 AM

Hello Allan,

 

 

Multiple runnable samples using the Kendo UI Grid and dataBinding are available here, please take a look as I believe they will help you start the project:

 

https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid

 

Regards,
Kiril Nikolov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mark
Top achievements
Rank 1
answered on 13 Nov 2015, 03:01 PM

Allan:

This may not be your issue, but I had a similar problem yesterday.  I am just getting started with the Telerik MVC stuff, and I created a grid that would read data (from database-first EF model) but would not add or update.  No errors, just would not do anything.

I tried to add a record to my table manually in SSMS and got an error (Primary key cannot be null) because the primary key on the table ("Id") was not set as an Identity field, which is what I had indented.  I changed the table, updated the EDMX in my project and then the grid worked. I was able to add, edit and delete.

Note that this I used the Kendo grid scaffolding helper in Visual Studio 2015 to do this and did not have to add or change any code manually to make it work.

Good luck.

Mark

 

0
Kiril Nikolov
Telerik team
answered on 17 Nov 2015, 08:12 AM

Hello Mark,

 

Thank you for sharing this, I am sure it will be helpful for many other users!

 

Regards,
Kiril Nikolov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Allan
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Mark
Top achievements
Rank 1
Share this question
or