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>
As I mentioned in the previous update, the DataRecord has a Cells property, which is a collection that holds all of the cells in that record. It does not have a Cell property. What you need is to use an indexer, like so :
Path= DataRecord.Cells[2].Tag
Hi, I've tryed this but it doesn't do the job:
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.