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

Behaviors broken after Q3 release

3 Answers 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Devlin
Top achievements
Rank 1
Devlin asked on 17 Nov 2011, 07:00 PM
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. 

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Nov 2011, 07:45 AM
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 >>

0
Devlin
Top achievements
Rank 1
answered on 18 Nov 2011, 05:58 PM
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?
0
Devlin
Top achievements
Rank 1
answered on 21 Nov 2011, 06:00 PM
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.
Tags
General Discussions
Asked by
Devlin
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Devlin
Top achievements
Rank 1
Share this question
or