You could try to use a list-view instead. Then you have more control about conditional visibility and conditional editability. In you case with a data-grid, you must apply enhanced entity access rules. So, for example the following two rules could be applied.
I'm not sure if a data-grid is hangling this very well though.
You could also upvote this request on the Q1 2016 idea forum. Suggested by Wouter Visser.
Bart is on the right track with the list view as it allows for far more configurability. However, you might want to consider using conditional visibility based on the attribute being changed rather than poking around in the complex world of access rules.
Using attribute conditional visibility is as simple as adding columns three and four twice. One set contains editable widgets and is visible when drop-down value is x and the other contains the same widgets with editability set to false and is visible when drop-down value is y.
The access rule option would entail adding an extra module role to the entity module. That role should be identical except that it allows only read access instead of read/write access. You then need to add an xpath to the role that read [dropDownValue = true()], or something along those lines.
You could look at the logic behind the Data Grid Extension (Flex Headers) in the Appstore and work it out from there.
Thanks to all for your answers. It helped me alot.