I tried to apply style for DataGrid globally as followed:
<Setter Property="ColumnWidth" Value="*"/>
<Setter Property="RowHeaderWidth" Value="0"/>
The style for
RowHeaderWidth works but the style for
ColumnWidth does not (there is empty column at the end of the DataGrid). When I set
ColumnWidth="*" explicitly in the DataGrid, then it works (the empty column has gone).
I wonder if we are able to set
ColumnWidth="*" globally in the Style? Thank you in advance!
In the project I'm working on, we make a lot of own controls that are in a
ResourceDictionary. We use the same exact method that you do. So, is your
Style tag in a
DataGrid.ColumnWidth cannot be applied style as other properties. We have to assign the value explicitly