Is it possible to make a foreign key have the ReadOnly attribute in Dynamic Data or at least disable the dropdown of the foreign key field?
Let's say:
Class_Table | Student_Table
ClassID [PK]| StudentID [PK]
ClassName | StudentName
| ClassID [FK]
Those are the tables. Here is a sample code:
[ReadOnly(true)]
[ScaffoldColumn(true)]
public object ClassID { get; set; }
Because whenever I assign the ReadOnly attribute to a foreign key and try to insert a new record it gives me this HttpException:
"DataBinding: 'System.Web.DynamicData.Util.DictionaryCustomTypeDescriptor' does not contain a property with the name 'ClassID'."