Home » WPF

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}">


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

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




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



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   |   Sharepoint   |   Azure