This is a migrated thread and some comments may be shown as answers.

Some BarCode controls require TwoWay binding for Text property

1 Answer 42 Views
BarCode
This is a migrated thread and some comments may be shown as answers.
Matthias
Top achievements
Rank 1
Matthias asked on 30 Mar 2018, 12:17 PM

Hello,

some BarCode controls such as "Code 39 Extended" and "Code 25 Interleaved" require a TwoWay binding of the "Text" property when used in a MVVM scenario. (And some do not, such as "Code 128")

It took us several hours to find that out.

My suggestion is to improve the documentation for this behaviour.
In the demos and documentation only a fixed text is used.

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 03 Apr 2018, 10:50 AM
Hello Matthias,

Thank you for your feedback. 

The reported behavior is caused by the fact that some of the RadBarcode controls set and validate the Text property in code. Binding to a property from your ViewModel has a lower precedence than setting it locally in code which means the binding is ignored. That's why in order the binding to work you need to set the Mode to TwoWay which has higher precedence than OneWay and setting a local value. You can take a look at the Dependency Property Setting Precedence List article which could help you better understand the mentioned behavior.
Indeed this behavior is not described in our documentation. I have logged internal item to include this in the documentation of the RadBarCode control. Your Telerik Points have been updated for this report.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
BarCode
Asked by
Matthias
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or