Home » WPFRSS

DataGrid question: How to set Column.CellStyle from a cell style

I want a whole column to turn yellow when a cell in that column is moused over.  Here's my style:

 

<Style x:Key="RightAlignCell" TargetType="{x:Type Custom:DataGridCell}">

        <Style.Triggers>

            <Trigger Property="IsMouseOver" Value="True">

                <Setter Property="Column.CellStyle" Value="ColumnStyle"/>

            </Trigger>

        </Style.Triggers>

 

        <Setter Property="TextBlock.TextAlignment" Value="Right"/>

    </Style>

 

The compiler throws this error:

"Cannot resolve the Style Property 'CellStyle'. Verify that the owning type is the Style's TargetType, or use Class.Property syntax to specify the Property. "

 

I'm not sure what this error means.  Is what I'm trying to do possible with a simple trigger?


<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter