How to add a second field for editing to EditorTemplateName?

2 posts, 0 answers
  1. Andrey
    Andrey avatar
    1 posts
    Member since:
    Jan 2016

    Posted 13 Jan 2017 Link to this post

    How can I edit a combination of two fields in the template?

    columns.Bound(b => b.BeginDate)
                    .ClientTemplate("#= getDates(BeginDate,EndDate) #")
                    .EditorTemplateName("ClientEditor");

    ClientTemplate - no problem, shows that you need and how you need just two field

    EditorTemplateName:

    @model DateTime?

    <div>@(Html.Kendo().DatePickerFor(m => m))</div>

    <div>@(Html.Kendo().DatePickerFor( ?????? ))</div>

     

    columns.Bound(b => b) - is not working :(

    .EditorViewData(new { endDate = #= EndDate # }) - is not working :(

     

     

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2422 posts

    Posted 16 Jan 2017 Link to this post

    Hi Andrey,

    You can add a second editor in the template, but it could not be bound to the model for the template and instead, you need to set the Name property of the second editor to match the name of the other field:
    @(Html.Kendo().TextBoxFor(m=>m))
    @(Html.Kendo().TextBox().Name("SecondFieldName"))

    Hope this helps.


    Regards,
    Konstantin Dikov
    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