Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1024
Style for cells
posted

 

 

 

 

 

 

 

 

 

Hi, I;m trying to make a style that paints the cells background when the cell's Tag property equals to "true". I've created the follwing Style but it doesn't do the job.

<Style x:Key="r" x:Name="r" TargetType="{x:Type igDP:CellValuePresenter}">

 

 

 

<Style.Triggers>

 

 

 

<DataTrigger Binding="{Binding Cell.Tag, RelativeSource={RelativeSource Self}}" Value="true">

 

 

 

<Setter Property="Background" Value="Yellow"/>

 

 

 

</DataTrigger>

 

 

 

</Style.Triggers>

 

 

 

</Style>

Parents
  • 69686
    posted

    Hello,

    There is an issue with the style that you have created. With the current binding expression, you are trying to bind to the Cell's Tag property of the CellValuePresenter, however the CVP does not expose such property. For this , you will need not to set the RelativeSource property and let it resolve to the DataRecord, which exposes the Cells collection. From there, you will have access to the cells and their Tags.

Reply Children