I have datagrids (from the WPF toolkit) that are read only. Nevertheless, once in a while certain dataset (ADO.NET) columns were producing the following error:
“A TwoWay or OneWayToSource binding cannot work on the read-only property …”
even if the corresponding binding used the OneTime or OneWay mode.
This was happening for each expression column in my dataset tables.
What I learned:
1. There is a bug in the WPF toolkit (don’t know whether it’s removed in VS 2010), that sets the binding as TwoWay even if it is explicitly defined as OneWay/OneTime.
2. To avoid the problem one simply needs to specify IsReadOnly=”True” for all expression columns.
PS. Same error occurs if the column is created using calculations in the SELECT statement.
