Readonly columns in Batch edit mode

4 posts, 1 answers
  1. Shawn
    Shawn avatar
    49 posts
    Member since:
    Jul 2011

    Posted 05 Jul 2012 Link to this post

    I'd like to use a Kendo grid in batch edit mode, but need to mark certain columns as readonly.  Is this feature supported?  If so, please advise as to how I can do this.  If not, could you advise as to when we can expect this?

    EDIT: I see that this is still an issue in the Q2-2012 KendoUI release.  Please advise if/when you will be supporting this feature?
  2. Santiago
    Santiago avatar
    6 posts
    Member since:
    Jul 2012

    Posted 24 Jul 2012 Link to this post

    Can you provide where you found that this is an issue of Q2 ?

    Best regards,
    Santiago.
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Shawn
    Shawn avatar
    49 posts
    Member since:
    Jul 2011

    Posted 25 Jul 2012 Link to this post

    @Santiago...I found it to be an issue in Q2-2012 by downloading it, using it in my project and then trying to assign set a column as readonly in my BatchEdit grid.
  5. Answer
    Mathias
    Mathias avatar
    34 posts
    Member since:
    Apr 2012

    Posted 31 Jul 2012 Link to this post

    I think I found the solution for your problem. I had the same problem and found out that there are some differences in this case in comparison to Telerik (where ReadOnly was a property for a column)

    In your DataSource you have to specify which column should not be editable:
    .DataSource(dataSource =>
        dataSource.Ajax().Read("AjaxInitGrid", "Shared").Model(model =>
        {
            model.Id(p => p.ID);
            model.Field(p => p.CreationDate).Editable(false);
               model.Field(p => p.BirthDate).Editable(false);
        })
    )

    Using .Editable(false) makes columns which are bound to these properties ReadOnly. I don't know why, but the model.Id - line is necessary.

    Hope I was able to help you.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready