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

Kendo control in EditorTemplate

3 Answers 2158 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dina
Top achievements
Rank 1
Dina asked on 29 Apr 2017, 10:18 PM

Is any way to access kendo controls in EditorTemplate?

If I have

@Html.Kendo().DropDownList().Name("Name1").HtmlAttributes(new { style = "width:100%;" })

int EditorTemplate

In Edit event of grid or inside EditorTemplate attempt to access kendo controls returns undefined value like

$("#Name1").data("kendoDropDownList") is undefined.

 

It undefined in edit event, it undefined anywhere I believe due to control is not being initialized yet.

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 02 May 2017, 11:32 AM
Hi Dima,

Note that when defining an editor template the Name of the widget should correspond to the name of the field in the DataSource. 

Alternatively you can use the [WidgetName]For format and remove the Name() property. In this case it will be set automatically.

If you would like more information on editor templates you would find the article below interesting.



Regards,
Viktor Tachev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Steve
Top achievements
Rank 1
answered on 19 Aug 2019, 03:52 PM

Viktor,

That link is broken.

Steve

0
Viktor Tachev
Telerik team
answered on 21 Aug 2019, 10:53 AM

Hello Steve,

 

Thank you for letting us know. We added a redirect so resources pointing to the previous link can continue working as expected. You can see the actual location of the Editor Templates article in the link below:

https://docs.telerik.com/aspnet-mvc/helpers/data-management/grid/templating/editor-templates

 

Regards, Viktor Tachev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Dina
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Steve
Top achievements
Rank 1
Share this question
or