Some BarCode controls require TwoWay binding for Text property

2 posts, 0 answers
  1. Matthias
    Matthias avatar
    1 posts
    Member since:
    Mar 2018

    Posted 30 Mar 2018 Link to this post


    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.

  2. Dinko
    Dinko avatar
    889 posts

    Posted 03 Apr 2018 Link to this post

    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.

    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.
Back to Top