I have some code that does
<Style TargetType="ListViewItem">
<Setter Property="XX" Value="true" />
</Style>
This works as expected on ListViews. However I want to replace the ListView with a DataGrid, and having trouble finding the equivalent of a ListViewItem for the Datagrid. At first thought I expected Datagrid items to inherit from ListView, so that nothing had to be changed, but the Setter had no effect. Then I changed it to:
<Style TargetType="DataGridRow">
<Setter Property="XX" Value="true" />
</Style>
But it had also no effect. And DataGridItem or DataGridViewItem does not exist, so i’m running out of options. So, what TargetType do I need?
You can set generic styles on
DataGridRow,DataGridColumnorDataGridCell. Which one you use depends on what setter you are setting.