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

Changing GridViewCell.BackgroundProperty doesn't work after update telerik controls

2 Answers 73 Views
Chart
This is a migrated thread and some comments may be shown as answers.
marcos
Top achievements
Rank 1
marcos asked on 17 Mar 2011, 11:19 AM

Hey,

I've recently updated the telerik controls from 2010Q3 to 2011 Q1. In my project I bind the cellstyleselector property of the gridviewdatacolumn to a class (the reference is set in the resources)... I do this by

<telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=XYZ}" Header="ABC" CellStyleSelector="{StaticResource myStyle}" IsReadOnly="True" />

where myStyle is more or less this:

public static void SetStyle(DependencyObject container, decimal limit, ThresholdSettings _val)
        {
            if (limit >= (decimal)_val.TopValue)
            {
                container.SetValue(GridViewCell.BackgroundProperty, StringToColor.Convert(_val.FirstColor));
            }
            else
            {
                if (limit <= (decimal)_val.BottomValue)
                    container.SetValue(GridViewCell.BackgroundProperty, StringToColor.Convert(_val.ThirdColor));
                else
                    container.SetValue(GridViewCell.BackgroundProperty, StringToColor.Convert(_val.SecondColor));
            }
        }

Before the update everything works fine and the background of the cells where green, yellow or red. But now nothing is coloured... Do you have an idea why an how to solve this problem???

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 17 Mar 2011, 12:15 PM
Hello,

 We have similar example where everything works as expected. Can you send us small runnable project where we can reproduce this wrong behavior compared to the previous Q?

Best wishes,
Vlad
the Telerik team
0
marcos
Top achievements
Rank 1
answered on 17 Mar 2011, 02:33 PM
I've made a bug report (ticket ID 404456) with a attached solution where you can reproduce the issue...
Tags
Chart
Asked by
marcos
Top achievements
Rank 1
Answers by
Vlad
Telerik team
marcos
Top achievements
Rank 1
Share this question
or