How to make DataGrid transparent?I am trying to use Background of DataGrid, but this does not work.
UPD I need only a background and transparent borders, not all! The text should be visible.
So my solution ... is used both Background = "Transparent" and RowBackground = "Transparent"
Have you tried setting the Opacity property to 0.0?
A value of 0.0 makes the item completely transparent.
<DataGrid Background="Transparent" RowBackground="Transparent"> </DataGrid>
This is an undocumented feature, but if you set the visibility to βHiddenβ in the same way as setting the transparency of an element.
I'm not sure which background you are trying to change, but you can set any background by overriding the DataGrid ControlTemplate. It is best to probably copy the default DataGrid ControlTemplate, and then change the background you want to suit your needs.
Try the following:
Background="Transparent" RowBackground="Transparent"
and
<DataGrid.ColumnHeaderStyle> <Style TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="Background" Value="Transparent" /> <Setter Property="FontWeight" Value="Bold" /> </Style> </DataGrid.ColumnHeaderStyle> <DataGrid.RowHeaderStyle> <Style TargetType="{x:Type DataGridRowHeader}"> <Setter Property="Background" Value="Transparent" /> </Style> </DataGrid.RowHeaderStyle>