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

How to add a second field for editing to EditorTemplateName?

1 Answer 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrey
Top achievements
Rank 1
Andrey asked on 13 Jan 2017, 08:55 AM

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 :(

 

 

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 16 Jan 2017, 01:57 PM
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.
Tags
Grid
Asked by
Andrey
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or