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

Model Editable definition for PopUp edit mode

2 Answers 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dimitrij
Top achievements
Rank 1
Dimitrij asked on 15 Apr 2015, 08:18 AM

I found out that defining "Editable(false)" for a model field doesn't seem to work when I've chosen GridEditMode.PopUp:

@(Html.Kendo().Grid<Pharmacy>()
    .Columns(columns => ...)
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model =>
        {
            model.Id(p => p.Id);
            model.Field(p => p.Id).Editable(false);
            model.Field(p => p.MyReadOnlyField).Editable(false);
        }))
)

In this case, the "Id" field and the "MyReadOnlyField" field will be shown in the popup as editable - which obviously is not the expected behavior.

Is this done intentional or is it a bug that Model definition doesn't work correctly with PopUp edit mode? Of course I can define a custom template, but that's not what I really want... from my view it's a bug or missing feature.

 

Thanks in advance,
Dimitrij

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Boyan Dimitrov
Telerik team
answered on 16 Apr 2015, 02:41 PM

Hello Dimitrij,

Please add the following DataAnnotation attribute  [HiddenInput(DisplayValue = false)]  to the Model property as shown in this article

 

Regards,
Boyan Dimitrov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Dimitrij
Top achievements
Rank 1
answered on 16 Apr 2015, 03:02 PM

Hi Boyan,

thanks, this works fine. You should consider to move this valuable information to a more prominent place in your documentation.

Kind regards,
Matthias

Tags
Grid
Asked by
Dimitrij
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Dimitrij
Top achievements
Rank 1
Share this question
or