2

First of all, I'm a complete novice with Kendo UI/Client side code.

I'm used to using standard MVC scaffolding to display my tables (Entity first):

  +------------------------------------+
  | +--------------------------------+ |
  | |___ID___|__Name_|__price_|______| |
  | |        |       |        |CRUD  | |
  | |        |       |        |      | |
  | |        |       |        |      | |
  | |        |       |        |      | |
  | |        |       |        |      | |
  | +--------+-------+--------+------+ |
  +------------------------------------+

where the CRUD part shows:

@Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
@Html.ActionLink("Details", "Details", new { id=item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id=item.ID })

In terms of the Kendo Grid, however, I'm at a loss as to incorporating their Actions with these.

I.e. How am I meant to be 'adding' their inline or (preferably) pop up editing with this?

My model is a database table:

@model IEnumerable<ProjectName.Models.TableName>

I am currently giving the table an ID and using the following script:

<script>
    $(document).ready(function () {
        $('#myTablesID').kendoGrid({
            scrollable: true,
            sortable: true,
            groupable:true,
            pageable: true,
            selectable: "row",
            filterable: true,
            resizable: true,
            dataSource: { pageSize: 10 }
        });
    });
</script>

Is there a 'standard' way of using the MVC scaffolding with pop up editing in the Kendo Grid?

1 Answer 1

0

The HTML5/Javascript source in this link is a very good place to start. http://demos.telerik.com/kendo-ui/grid/editing-popup

You have to set up matching controller actions. Refer to the Editing_PopupController.cs example in the ASP.NET MVC source section

5
  • To be honest, that was the first place I started. But It doesn't say what/where the productService is defined :( Unless it's just the db.TableName.Remove / etc?
    – jbutler483
    Nov 19, 2014 at 10:27
  • I have used the MVC HtmlHelpers that come with Kendo (Kendo.Mvc.dll). The editing_popup.cshtml example shows how to use them and more in line with the MVC scaffold way of doing things. Nov 19, 2014 at 10:34
  • I am realizing now that your question is more about looking for a way to bake it into the code that scaffolding spits out. I haven't come across where this has been done. I am also realizing that I am not being much help. Sorry. Nov 19, 2014 at 10:49
  • That's ok, but I'm certain i'm missing something here - After all, telerik advertise their product to be full compatible with MVC, so i'm slightly abashed as to why this doesn't seem to be obvious
    – jbutler483
    Nov 19, 2014 at 10:54
  • Well, you right about what you said about any productService lines of code from the example is supposed to be replaced with your db.TableName.Add(entity); db.SaveChanges(); lines of code. Nov 19, 2014 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.