Conditional formatting - cell border paint issues
I have the following styles defined in my xaml file..
<UserControl.Resources>
<Style x:Key="redStyleNumber" TargetType="ig:PivotCellControl">
<Setter Property="Foreground" Value="Red" />
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<Style x:Key="normalStyleNumber" TargetType="ig:PivotCellControl">
<Setter Property="Foreground" Value="Black" />
and using those styles as shown below in codebehind..
private void pivotGrid_CellControlAttached(object sender, Infragistics.Controls.Grids.PivotCellControlAttachedEventArgs e)
{
int column = this.pivotGrid.DataColumns.IndexOf(e.Cell.DataColumn);
int row = this.pivotGrid.DataRows.IndexOf(e.Cell.DataRow);
if (this.pivotGrid.DataSource != null && pivotGrid.DataSource.Result != null)
ICell cellData = this.pivotGrid.DataSource.Result.Cells[row, column];
if (cellData != null && (cellData.Value is double?))
double value = (double)cellData.Value;
if (value < 0)
e.Cell.Style = this.Resources["redStyleNumber"] as Style;
}
else
e.Cell.Style = this.Resources["normalStyleNumber"] as Style;
e.IsDirty = true;
the problem is... the cell borders are not rendered correctly with this code.. Didn't create a separate sample for this... Hopefully you'll be able to reproduce with the above code..
Hi
Please use HorizontalContentAligment instead HorizontalAligment. The meaning of properties are different and it is normal behavior when you use HorizontalAligment
<Setter Property="HorizontalContentAlignment" Value="Right" />
Regards Todor
That fixed it.... Thanks.