WPF: how can I style DataGridTextColumn in one style class?
-
12-11-2019 - |
Pregunta
I try to stylize DataGridTextColumn setting Header and Cell styles separatly:
<Style x:Key="headerStyle">
<Setter Property="DataGridColumnHeader.Background" ... />
...
<Style x:Key="cellStyle">
<Setter Property="DataGridCell.Background" ... />
...
<DataGrid>
<DataGrid.Columns>
<DataGridTextColumn
HeaderStyle="{StaticResource ResourceKey='headerStyle'}"
CellStyle="{StaticResource ResourceKey='cellStyle'}" ... />
Can I stylize DataGridTextColumn Header, Cell and other properties in one style declaration?
Solución
As far as i can tell that might be impossible since DataGridTextColumn
does not provide a Template or Style property of its own which could be used to set the other styles collectively.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow