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

[Solved] Bug: RadGrid Column's ReadOnly is ignored for InForm and Popup GridEditModes

2 Answers 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Patrick
Top achievements
Rank 2
Patrick asked on 27 Mar 2012, 01:11 AM
I have a key field called Name which I do want to be displayed in the Grid, and also when editing a record, but I don't want it to be editable in the Edit form.

So I defined that column as follows in my Telerik MVC3 project's view page:

            columns.Bound(o => o.Name).Width(100).ReadOnly(true); // make the key column read only

This works fine if the GridEditMode is set to InLine, but not otherwise. If GridEditMode is set to InForm or PopUp, the field is fully editable for both server or client side binding, i.e. the ReadOnly property of the column only appears to work for GridEditMode = InLine.

Am I right in thinking this is a bug?  Is there a workaround? I like the PopUp mode best, because it prevents users from clicking Edit or Delete links on other records before they have finished dealing with the current record that they are editing, but it is a nuisance that the ReadOnly property is being ignored.

Thanks

2 Answers, 1 is accepted

Sort by
0
Patrick
Top achievements
Rank 2
answered on 28 Mar 2012, 11:31 AM
Just to add that actually, the problem that I felt there was with InLine or InForm editing, namely that it doesn't stop users from clicking Edit or Delete on another row, is less important than I thought: if that happens, the user just loses any changes they have made in the current row and it is the same as clicking Cancel and then clicking Edit/Delete on another row, but quicker.

But I still think the ReadOnly property should work for all 3 edit modes?
0
Petur Subev
Telerik team
answered on 28 Mar 2012, 12:40 PM
Hello Patrick,

The editor templates used for the InForm and Popup edit modes are generated on the Server using the EditorForModel helper. To successfully customize the editor template used for the Popup window you should check this Code Library article.

All the best,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Grid
Asked by
Patrick
Top achievements
Rank 2
Answers by
Patrick
Top achievements
Rank 2
Petur Subev
Telerik team
Share this question
or