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

Setting a style to GridViewRow works in SL5 but not in SL4

3 Answers 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kornelije
Top achievements
Rank 1
Kornelije asked on 17 Jul 2012, 08:23 AM

I have a Silverlight 4 application, and the version of the GridView binary is 2012.1.215.1040.

However, it seems that the GridView binary expects a Sliverlight 5 runtime.

This code throws an exception (Arg_TargetInvocationException):

<Style 
    x:Key="gridValueRowStyle"
    TargetType="telerik:GridViewRow">
    <Setter 
        Property="Background"
        Value="{Binding State, Converter={StaticResource stateToBrushConverter}}" />
</Style>

This exception is thrown only on computers with SL4 runtime. Note that the style doesn't have to be applied to GridView. Simply defining the style like this in Page resources is enough to throw an exception.

Is this the bug or is this version of the GridView binary expected to work only with SL5?

If the latter is true, where can I find the latest GridView version that would work on SL4 and where can I find the change log between that version and the version I currently have?

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 17 Jul 2012, 12:50 PM
Hello Kornelije,

 


Bindings on style setters are supported in SL5, not in SL4. The mentioned control version (2012.1.215.1040 ) is built against Silverlight 4. Those for Silverlight 5 end with the extension 1050. You may download the latest version of our controls (Sl4/SL5) under Your Account. Following this link you may read more about the latest features and improvements for RadControls/Silverlight.   
Thank you!


Greetings,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Kornelije
Top achievements
Rank 1
answered on 18 Jul 2012, 09:31 AM

I see.

I suppose it would be nice if the XAML parser would warn about that, but it's not important anymore.

So if this does not work in SL4, that means that I am forced to use a StyleSelector and create a style for each possible value the property can have. Is that correct?

0
Vanya Pavlova
Telerik team
answered on 18 Jul 2012, 10:55 AM
Hello Kornelije,

 


Yes you are right - the recommended approach to apply a style based on underlying property value is through using StyleSelectors. It works for both (SL4/SL5) - please check our online demos for further reference.   




Regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Kornelije
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Kornelije
Top achievements
Rank 1
Share this question
or