0
votes

I'm trying to populate an editable kendo grid. In all examples I see e.g. http://demos.telerik.com/aspnet-mvc/grid/editing-inline , the inline editor cells seem to be normally displayed as kendoNumericTextBox.

I'm looking e.g. at this example (approved answer) Kendo UI Grid Conditional editing, where it is accessed in the following way:

e.container.find("input[name=DiscountPercentageMRC]").data("kendoNumericTextBox")

Apart from this jsFiddle I cannot access the numeric textboxes in this way. Where can the problem be?

1
No, it is just a normal HTML5 input text with kendo UI style applied. <input type="text" class="k-input k-textbox" name="ProductName" required="required" data-bind="value:ProductName"> - Vijai

1 Answers

1
votes

Judging by the two versions of the question, I assume that you are asking why sometimes the edit textboxes are Kendo UI textboxes (e.g. NumericTextBox or Kendo-UI-styled input), and sometimes are plain inputs.

When the Kendo UI MVC Grid wrapper is used, the editor widgets depend on the following:

  • the default ASP.NET MVC editors for specific data field types.
  • the editor template files placed in the /EditorTemplates/ folder(s).

Probably you don't have the Kendo UI editor template files in your application, that's why no Kendo UI widgets are used in edit mode. Please verify that.

The built-in Kendo UI editor templates are avaialble in the wrappers/aspnetmvc/EditorTemplates folder of the "UI for ASP.NET MVC" installation.

http://docs.telerik.com/kendo-ui/aspnet-mvc/introduction#distribution-contents

Here is how to use them or create your own editor templates:

http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/templating/editor-templates

After you have the Kendo UI widgets being used as editors, you can access them in the Grid's edit event like this:

http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Editing/access-editor-control

Plain textbox editors and Kendo-UI-styles plain inputs are accessed as standard input elements via the respective field name. No .data('kendoWidgetName') method is needed:

var productNameTextBox = e.container.find("[name=ProductName]");