Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8758801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:38:30+00:00 2026-06-13T14:38:30+00:00

ASP.Net MVC 3, Kendo UI Web, Kendo grid control. I configured several fields to

  • 0

ASP.Net MVC 3, Kendo UI Web, Kendo grid control.

I configured several fields to be read-only:

.Model(model =>
      {
          model.Field(it => it.foobar).Editable(false);
          ...

and it works as expected in inline mode. But when I switch the mode to popup, the editor show entire structure, so I can edit any field I want (those marked as non-editable as well).

So how to mark them so the popup editor would show only those marked for edits?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:38:31+00:00Added an answer on June 13, 2026 at 2:38 pm

    Popup editor uses MVC’s editor template, which is completely independent of Kendo’s. If you want to tag that field as readonly, you need to attach a metadata attribute in the model in code. Ex:

    public class MyClassUsedInGrid
    {
        [System.ComponentModel.DataAnnotations.Editable(false)]
        public string foobar {get;set;}
    }
    

    Update:

    Apologize, the answer was incomplete originally. You need to create a custom template to handle this, as built in ones don’t support it (I had this in my project and forgot about it). To do this, create a view under /Views/Shared/EditorTemplates/string.cshtml (I’m going to be showing this in Razor, it’s easy to port to aspx syntax though).

    The code would look like the following:

    @model string
    @if(ViewData.ModelMetadata.IsReadOnly){
        @Html.DisplayForModel()
    }else{
        @Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, new { @class = "text-box single-line" })
    }
    

    This will properly process Editable metadata attribute. Of course this is just for string, you should do something similar for other objects. If you’re looking for what other build in templates look like, check this site: http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-3-default-templates.html

    Performance Sidenote: If you only do this in one place in few places in application, it’s probably better to place it under /Views/YourView/EditorTemplates/ instead. The reason is the built in templates are compiled into the framework and will work faster in general. Alternatively leave it in Shared folder, but name it something like ExtendedString, and then in you view tag properties which you set Editable with explicit UI hint like so:

    [System.ComponentModel.DataAnnotations.Editable(false)]
    [System.ComponentModel.DataAnnotations.UIHint("ExtendedString")]
    public string foobar {get;set;}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ASP.Net MVC 3, Kendo UI Web, Kendo grid control. My main datasource uses foreign
The situation: I have build a Grid with kendo-ui web (in ASP.NET MVC 3)
ASP.Net MVC Controllers have several methods of forwarding control to another controller or action.
ASP.Net MVC 3, Kendo UI Web. Typical example -- there is a database and
I have an asp.net MVC web app using Kendo UI Grids with client templates.
I am trying to use the new Kendo UI grid from asp.net mvc 3.
ASP.NET MVC web app that exposes friendly URLs: http://somesite.com/friendlyurl ...which are rewritten (not redirected)
ASP.NET MVC seems to correctly automatically bind between HTML form's file input field and
My ASP.NET MVC web site markup looks wrong in iOS (both iPad and iPhone).
ASP.NET MVC Model Binding is still new to me and I'm trying to understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.