Accessing readonly model data inside of an event Custom Editor Template

2 posts, 1 answers
  1. Tate
    Tate avatar
    5 posts
    Member since:
    Jun 2015

    Posted 07 Jul 2015 Link to this post

    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?
  2. Answer
    Vladimir Iliev
    Vladimir Iliev avatar
    2206 posts

    Posted 08 Jul 2015 Link to this post

    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>
        <label>Title:</label><span data-bind="text: title"></span>

    <h3>Edit meeting:</h3>

    Vladimir Iliev
    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
Back to Top