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

[Solved] CellDecorationStyleSelector

1 Answer 83 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alfred
Top achievements
Rank 1
Alfred asked on 02 May 2013, 10:23 PM
MOVED TO THE GRID FORUM!

I am attempting to format the cells of a grid using the CellDecorationStyleSelector. Everything appears to work fine until I scroll up and down the grid.  As I do that the grid formatting changes, and is no longer set to the values set by my formatting with the CellDecorationStyleSelector.  Please let me know if this is a known issue.  Below is the relevant portion of my Xaml code.

Thanks,
Al


< common:ProjectStyleSelector x:Key="ProjectBackStyleSelector">
                    <common:ProjectStyleSelector.Level0>
                        <Style TargetType="Rectangle">
                            <Setter Property="Fill" Value="AliceBlue"/>
                        </Style>
                    </common:ProjectStyleSelector.Level0>
                    <common:ProjectStyleSelector.Level1>
                        <Style TargetType="Rectangle">
                            <Setter Property="Fill" Value="SteelBlue"/>
                        </Style>
                    </common:ProjectStyleSelector.Level1>
                    <common:ProjectStyleSelector.Level2>
                        <Style TargetType="Rectangle">
                            <Setter Property="Fill" Value="LightSteelBlue"/>
                        </Style>
                    </common:ProjectStyleSelector.Level2>                   
                </common:ProjectStyleSelector>
                <common:ProjectStyleSelector x:Key="ProjectStyleSelector">                   
                    <common:ProjectStyleSelector.Level0>
                        <Style TargetType="TextBlock">
                            <Setter Property="FontWeight"
                                Value="ExtraBlack" />
                            <Setter Property="Foreground"
                                Value="Black" />
                            <Setter Property="FontSize"
                                Value="20" />
                            <Setter Property="Margin"
                                Value="0,0,0,0" />
                        </Style>
                    </common:ProjectStyleSelector.Level0>
                    <common:ProjectStyleSelector.Level1>
                        <Style TargetType="TextBlock">
                            <Setter Property="Foreground"
                                Value="Black" />
                            <Setter Property="Margin"
                                Value="5,0,0,0" />
                        </Style>
                    </common:ProjectStyleSelector.Level1>
                    <common:ProjectStyleSelector.Level2>
                        <Style TargetType="TextBlock">
                            <Setter Property="Foreground"
                                Value="Black" />
                            <Setter Property="Margin"
                                Value="10,0,0,0" />
                        </Style>
                    </common:ProjectStyleSelector.Level2>                   
                </common:ProjectStyleSelector>

< Grid:RadDataGrid.Columns>
                    <Grid:DataGridTextColumn PropertyName="TaskOutlineLevel" Header="L" SizeMode="Auto" CellDecorationStyleSelector="{StaticResource ProjectBackStyleSelector}" />
                    <Grid:DataGridTextColumn PropertyName="TaskOutlineNumber" Header="Outline" SizeMode="Auto" CellDecorationStyleSelector="{StaticResource ProjectBackStyleSelector}"/>
                    <Grid:DataGridTextColumn PropertyName="TaskIsSummary" Header="Smry" SizeMode="Auto" CellDecorationStyleSelector="{StaticResource ProjectBackStyleSelector}" />
                <Grid:DataGridTextColumn PropertyName="TaskName" Header="Task Name" CellContentStyleSelector="{StaticResource ProjectStyleSelector}" CellDecorationStyleSelector="{StaticResource ProjectBackStyleSelector}" />
                    <Grid:DataGridTextColumn PropertyName="TaskStartDate" CellContentFormat="{}{0:MM/dd/yyyy}" SizeMode="Auto" Header="Start" CellDecorationStyleSelector="{StaticResource ProjectBackStyleSelector}" />
                    <Grid:DataGridTextColumn PropertyName="TaskFinishDate" CellContentFormat="{}{0:MM/dd/yyyy}" SizeMode="Auto" Header="Finish" CellDecorationStyleSelector="{StaticResource ProjectBackStyleSelector}" />
                    <Grid:DataGridTextColumn PropertyName="TaskReaminingWork" CellContentFormat="{}{0,0:N0}" SizeMode="Auto" Header="Reamining Work" CellDecorationStyleSelector="{StaticResource ProjectBackStyleSelector}"/>
                    <Grid:DataGridTextColumn PropertyName="TaskPercentWorkCompleted" CellContentFormat="{}{0:N0}" SizeMode="Fixed" Width="100" Header="% Work Completed" CellDecorationStyleSelector="{StaticResource ProjectBackStyleSelector}"/>
                    <Grid:DataGridTextColumn PropertyName="TaskWork" CellContentFormat="{}{0,0:N0}" SizeMode="Auto" Header="Work" CellDecorationStyleSelector="{StaticResource ProjectBackStyleSelector}"/>
                    <Grid:DataGridTextColumn PropertyName="TaskActualCost" CellContentFormat="{}{0,0:N0}" SizeMode="Auto" Header="Actual Work" CellDecorationStyleSelector="{StaticResource ProjectBackStyleSelector}"/>
            </Grid:RadDataGrid.Columns>

1 Answer, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 03 May 2013, 02:21 PM
Hi Alfred,

To avoid duplication of answers, I have replied you in the following forum thread - http://www.telerik.com/community/forums/metro/grid-xaml/celldecorationstyleselector.aspx.

 

Kind regards,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Chart for XAML
Asked by
Alfred
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Share this question
or