I've a read only property I need to display in a textbox, and getting this error at runtime. I've set IsEnabled="False" IsReadOnly="True" - no luck. Other searches say the readonly should fix it, but not for me. I've got an ugly workaround by adding a dummy setter...
views:
3234answers:
1
+13
A:
It's hard to guess without code, but you should be able to set the BindingMode to OneWay.
<TextBox Text="{Binding Path=MyProperty, Mode=OneWay}" />
or from code:
Binding binding = new Binding();
binding.Mode = BindingMode.OneWay;
Razzie
2009-02-26 12:14:50
Yep, "Mode=OneWay" == Read Only; "Mode=OneWayToSource" == Write Only
Bryan Anderson
2009-02-26 14:40:51