This question is locked. New answers and comments are not allowed.
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>
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>