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

3 posts, 1 answers
  1. marcos
    marcos avatar
    11 posts
    Member since:
    Dec 2010

    Posted 17 Mar 2011 Link to this post

    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. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 17 Mar 2011 Link to this post

    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
  3. marcos
    marcos avatar
    11 posts
    Member since:
    Dec 2010

    Posted 17 Mar 2011 Link to this post

    I've made a bug report (ticket ID 404456) with a attached solution where you can reproduce the issue...
Back to Top