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

Readonly columns in Batch edit mode

3 Answers 769 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 2
Shawn asked on 05 Jul 2012, 03:25 PM
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?

3 Answers, 1 is accepted

Sort by
0
Santiago
Top achievements
Rank 1
answered on 24 Jul 2012, 08:30 PM
Can you provide where you found that this is an issue of Q2 ?

Best regards,
Santiago.
0
Shawn
Top achievements
Rank 2
answered on 25 Jul 2012, 11:58 AM
@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.
0
Accepted
Mathias
Top achievements
Rank 1
answered on 31 Jul 2012, 07:46 AM
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.
Tags
Grid
Asked by
Shawn
Top achievements
Rank 2
Answers by
Santiago
Top achievements
Rank 1
Shawn
Top achievements
Rank 2
Mathias
Top achievements
Rank 1
Share this question
or