I am trying to use the conditionalformatcollection to format cells equal to 0 to be red. I used the following code:
<igGrid:TextColumn HeaderText="Weight" Key="Weight"><igGrid:TextColumn.ConditionalFormatCollection> <igGrid:EqualToConditionalFormatRule> <igGrid:EqualToConditionalFormatRule.Value> 0 </igGrid:EqualToConditionalFormatRule.Value> <igGrid:EqualToConditionalFormatRule.StyleToApply> <Style TargetType="igGrid:CellControl"> <Setter Property="Background" Value="Red" /> </Style> </igGrid:EqualToConditionalFormatRule.StyleToApply> </igGrid:EqualToConditionalFormatRule></igGrid:TextColumn.ConditionalFormatCollection></igGrid:TextColumn>
It works, but not for rows that are hovered, or that have the default alternate color. What do I need to do to fix this?
That works. Thanks!
Hi,In order to have the style applied on alternate rows you should use TargetType: ConditionalFormattingCellControl and set the AltBackground property:
... xmlns:ig="http://infragistics.com/Controls" ... <Style TargetType="ig:ConditionalFormattingCellControl"> <Setter Property="Background" Value="Red" /> <Setter Property="AltBackground" Value="Red" /> </Style> ...
If you want to change the way the hover style works you have to retemplate the ConditionalFormattingCellControl and change the MouseOver state. You can find an article about "Editing Style Properties Using Expression Blend" here http://help.infragistics.com/NetAdvantage/Silverlight/2009.1/CLR3.5/?page=SL_DesignersGuide_Editing_Style_Properties_Using_Expression_Blend.html
Regards