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

Accessing readonly model data inside of an event Custom Editor Template

1 Answer 127 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tate
Top achievements
Rank 1
Tate asked on 07 Jul 2015, 06:17 PM
I have been able to successfully build an integrate a Custom Editor Template for the events in the scheduler. However, There are certain fields in the Model being edited that I only want to display- the user should not be able to edit the values. I also want to include a button inside of the Custom Editor that links to another area of the web app based off of one of these readonly Model properties. However, I have been having issues getting these readonly properties to properly bind to the view... I have tried Html.DisplayFor, and this is not binding correctly. How can I properly bind and access the values for Model properties inside of a Custom Editor while keeping the values read-only?

1 Answer, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 08 Jul 2015, 10:55 AM
Hi Tate,

You can achieve the desired behavior by either using Kendo UI template syntax or using Kendo UI MVVM binding. Please check the example below which shows both approaches:

<h3>Edit meeting</h3>
<p>
    <label>Title:</label><span data-bind="text: title"></span>
</p>

<h3>Edit meeting:</h3>
<p>
    <label>Title:</label>#=title#
</p>

Regards,
Vladimir Iliev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
Tate
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or