Behaviors broken after Q3 release

4 posts, 0 answers
  1. Devlin
    Devlin avatar
    7 posts
    Member since:
    Jul 2011

    Posted 17 Nov 2011 Link to this post

    In our application we use attached behaviors on RadControls in a number of places to avoid code-behind (mvvm pattern). These are used for some custom validation logic in grids, automatic significant digits displays on NumericUpDowns, and many others. After updating to the latest release (2011.3.1116.35) the following error occurs on all of these behaviors:

    Cannot add content of type 'Behaviors.DynamicDecimalDigitsBehavior' to an object of type 'System.Windows.Interactivity.BehaviorCollection'.  Error at object 'Behaviors.DynamicDecimalDigitsBehavior' in markup file 'setdatarenderingpropertiesview.xaml' Line 270 Position 22.

    The project is built in .Net 3.5, and as such we reference System.Windows.Interactivity version 3.5.0.0. 
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 18 Nov 2011 Link to this post

    Hi,

    I'm not sure how upgrade of a our assemblies can break System.Windows.Interactivity behaviors. Can you try to debug to see what's says the error?

    Greetings,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Devlin
    Devlin avatar
    7 posts
    Member since:
    Jul 2011

    Posted 18 Nov 2011 Link to this post

    Thanks for the reply.

    First, I should note that by "all behaviors", I mean all the behaviors on telerik controls in Telerik.Windows.Controls, the behaviors on stock WPF controls are still functional. The error (shown in my first post) occurs after an instance of the behavior is started but before OnAttached() is called.

    Usually errors of this type occur when you try to attach a behavior to an incompatible type, for example trying to attach a Behavior<TextBlock> to a TextBox.

    Perhaps somehow the xaml is generating a different version of the RadNumericUpDown than the code behind, for example one is drawing from the GAC and the other directly from the .dll?
  4. Devlin
    Devlin avatar
    7 posts
    Member since:
    Jul 2011

    Posted 21 Nov 2011 Link to this post

    The GAC was indeed the issue, it turns out. The behaviors were breaking because for some reason the xaml was instantiating the older version of the RadNumericUpDown from the outdated assembly in the GAC, whereas the behavior was looking for the newer version of the control.

    While this is probably an issue isolated to my system, removing the Telerik.Windows.Controls.Input assembly using gacutil -u and re-installing the Q3 update fixed the problem.
Back to Top