Kendo control in EditorTemplate

2 posts, 0 answers
  1. Dima
    Dima avatar
    48 posts
    Member since:
    Feb 2012

    Posted 29 Apr Link to this post

    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.

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1788 posts

    Posted 02 May Link to this post

    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.
Back to Top