This question is locked. New answers and comments are not allowed.
Hi,
I have an existing third party table that I have created an EF model for. The table's primary key is a character field. In this scenario, if I use the definition directly or via a ViewModel with a Key dataannotation attribute I would expect the grid to behave in the same way as dynamic data web sites and enable the field for insert but display it as read only for updates (as renaming the primary key loses the context of what you are updating). The ScaffoldColumn data annotation attribute is respected so it would be good if the Key field was too.
I have worked around it for now by hashing a key in my view model to generate a (reasonably) unique integer id. However, it would be nice if the following functionality was supported:
- If the Key DataAnnotation attribute is set on the model then we should not need to specify the data keys
- If visible, items in key fields should be read only in update mode but editable in insert mode
I appreciate that this would probably be a breaking change (unless there was perhaps an additional option similar to autogenerate columns)
I have an existing third party table that I have created an EF model for. The table's primary key is a character field. In this scenario, if I use the definition directly or via a ViewModel with a Key dataannotation attribute I would expect the grid to behave in the same way as dynamic data web sites and enable the field for insert but display it as read only for updates (as renaming the primary key loses the context of what you are updating). The ScaffoldColumn data annotation attribute is respected so it would be good if the Key field was too.
I have worked around it for now by hashing a key in my view model to generate a (reasonably) unique integer id. However, it would be nice if the following functionality was supported:
- If the Key DataAnnotation attribute is set on the model then we should not need to specify the data keys
- If visible, items in key fields should be read only in update mode but editable in insert mode
I appreciate that this would probably be a breaking change (unless there was perhaps an additional option similar to autogenerate columns)