Posted 11 September 2018, 1:30 am EST - Updated 29 September 2022, 6:10 am EST
Hi.
I am setting a DataTable a data source for a worksheet and now I want to show an icon or an vector graphic object in the row header, depending on the data contained in each row. I have modified the style for RowHeaderCellPresenter like this
<Style TargetType="ss:RowHeaderCellPresenter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ss:RowHeaderCellPresenter">
<Border
Width="16"
Height="16"
Margin="4,-2,0,0"
VerticalAlignment="Center"
controls:VectorGraphic.Foreground="CornflowerBlue"
Child="{StaticResource VectorIconDelete}"
ToolTip="test tooltip"
ToolTipService.ShowDuration="6000000" >
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
The result is like this
Now, i have to place a trigger or something like that. But I have no clue how to get access to the data of each row, to set a different vector graphic depending on the rows data. Any ideas or other approaches?
Best regards,
Sascha