How to set wpf datagrid background color? There are only several rows in datagrid, and there is empty space below rows. How to set color of this gray space (see image above)
Here is my code:
<DataGrid x:Name="dataGrid"
ItemsSource="{Binding ReferentViewModels }"
SelectedItem="{Binding SelectedReferentViewModel}"
VerticalAlignment="Top"
AutoGenerateColumns="False"
IsReadOnly="true"
SelectionMode="Single"
SelectionUnit="FullRow"
Margin="0,0,0,0"
Height="NaN"
Background="Aqua"
>
<DataGrid.Columns>
<DataGridTextColumn Header="Naziv" MinWidth="200" Width="0.25" Binding="{Binding Name}"/>
<DataGridTextColumn Header="Opis" MinWidth="100" Width="*" Binding="{Binding Description}"/>
</DataGrid.Columns>
</DataGrid>
Also, simple style is applied:
<Style TargetType="{x:Type DataGrid}">
<Setter Property="AlternatingRowBackground" Value="Azure" />
<Setter Property="HeadersVisibility" Value="All" />
<Setter Property="RowHeaderWidth" Value="20" />
<Setter Property="CanUserResizeRows" Value="False" />
</Style>
I tried with background property, but it's not working.
