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

Kendo Grid and editing of a record

4 Answers 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christine
Top achievements
Rank 1
Veteran
Christine asked on 08 May 2020, 07:59 PM

I have a Grid and was wondering if there is a way to use the standard CRUD screens from the MVC application.  The reason for this is I have the screens and I like using them as I have them already.  I wanted to use inline editing but I never could get a way to get the drop down list to show up correctly.  If not, is there an easy way to being up an Edit and Create Screen?  I just want an easy way edit (and also create) a record.

 

Thanks for any help.

4 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 12 May 2020, 03:00 PM

Hi Christine,

If you want to have a DropDownList as a Grid editor in inline editing, you will have to use an editor template. See this demo: https://demos.telerik.com/aspnet-mvc/grid/editing-custom

In it the Grid has InCell editing configured, but it can easily be modified to InLine by removing the ToolBar's save configuration:

.ToolBar(toolBar =>
        {
            toolBar.Create();
            toolBar.Save();
        })

and setting InLine Editing mode:

.Editable(editable => editable.Mode(GridEditMode.InLine))

Check the ASP.NET MVC source section in the demo, which shows the views and controllers. The ClientCategory.cshtml view (in the EditorTemplates folder) is the one that contains the DropDownList. This is its content:

@model Kendo.Mvc.Examples.Models.CategoryViewModel

@(Html.Kendo().DropDownListFor(m => m)
        .DataValueField("CategoryID")
        .DataTextField("CategoryName")
        .BindTo((System.Collections.IEnumerable)ViewData["categories"])
)

Regards,
Ivan Danchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Christine
Top achievements
Rank 1
Veteran
answered on 12 May 2020, 04:59 PM
I have decided to go with a popup edit grid.  I am having the same issue, cannot get a dropdown to display.   Is there a link to show how to get it to work?  I am very frustrated with Kendo and find it very difficult to get anything to work.  I am even having issues with the little icons to display next to the field headers that will being up the search screen, they are not visible.  Something so simple but it does not work.  Very frustrated.....
0
Accepted
Ivan Danchev
Telerik team
answered on 14 May 2020, 01:30 PM

Hi Christine,

We are sorry to hear you are having such a hard time achieving the scenarios you are after. In addition to the documentation and demos,  which demonstrate the basic functionality of the components, we would recommend taking advantage of our Virtual Classroom: https://www.telerik.com/support/virtual-classroom It has different categories, UI for ASP.NET MVC including, so it can give you a better understanding of our suite of components and how to use them properly.

Moving back to the Grid, I've attached a sample runnable project to this reply, which shows a DropDownList can be used in the Grid's popup editor. The custom editor is set in the Grid's Editable configuration like this:

.Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("Person"))

The Person.cshtml view that contains the template can be located in Views/Shared/EditorTemplates

With regard to custom popup editors, you can find more information in the documentation here: https://docs.telerik.com/aspnet-mvc/html-helpers/data-management/grid/how-to/editing/custom-popup-editor

As for the the issue with the icons you mentioned, please elaborate more on exactly which icons you mean. Are they related to built-in functionality in the Grid, for example filter icons, or they are custom icons you are trying to add? In addition, a screenshot that shows the missing icons would be helpful and will give is a better idea of the case.

Regards,
Ivan Danchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Christine
Top achievements
Rank 1
Veteran
answered on 14 May 2020, 01:37 PM
Thanks I will take a look.  All I want to do is  create dropdown list so the user can easily select the item.  It seems to me that it might be beyond my skill set.  I have tried all sorts of ways and so far I cannot get what I need (a dropdown list???  to me that should be simple to do....).  Thanks and I will take a look at the project.
Tags
General Discussions
Asked by
Christine
Top achievements
Rank 1
Veteran
Answers by
Ivan Danchev
Telerik team
Christine
Top achievements
Rank 1
Veteran
Share this question
or