<Window x:Class="DataGrid_Sample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:DataGrid_Sample"
        mc:Ignorable="d"
        Title="DataGrid_Sample" Height="450" Width="800">
    <Grid>
        <DataGrid Name="datagrid1" AutoGenerateColumns="False" AlternationCount="2">
            <DataGrid.Resources>
                <Style TargetType="DataGridRow">
                    <Style.Triggers>
                        <Trigger Property="ItemsControl.AlternationIndex" Value="0">
                            <Setter Property="Background" Value="LightGray" />
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>

                        <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                            <Setter Property="Background" Value="Gray" />
                            <Setter Property="Foreground" Value="White" />
                        </Trigger>
                    </Style.Triggers>
                </Style>

                <Style TargetType="DataGridColumnHeader">
                    <Setter Property="Background" >
                        <Setter.Value>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientStop Color="Black" Offset="0.0" />
                                <GradientStop Color="LightGray" Offset="1.1" />
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="BorderBrush" Value="White" />
                    <Setter Property="BorderThickness" Value="1 0 0 0" />
                    <Setter Property="Margin" Value="-1" />
                    <Setter Property="Padding" Value="3 0 0 0" />
                    <Setter Property="Height" Value="30" />
                    <Setter Property="FontWeight" Value="Bold" />
                </Style>
            </DataGrid.Resources>

            <DataGrid.Columns>
                <DataGridTextColumn Header="Bestell-Nr." Binding="{Binding OrderID}" Width="100"/>

                <DataGridTemplateColumn Header="Lieferdatum" Width="100">
                    <DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                            <TextBlock Text="{Binding ShippedDate, StringFormat=dd.MM.yyyy}" />
                    </DataTemplate>
                </DataGridTemplateColumn.CellTemplate>

                    <DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <DatePicker SelectedDate="{Binding ShippedDate}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellEditingTemplate>
                </DataGridTemplateColumn>

                <DataGridComboBoxColumn x:Name="customerColumn" Header="Kunde" Width="*"
                        DisplayMemberPath="CompanyName"
                        SelectedValuePath="CustomerID"
                        SelectedValueBinding="{Binding CustomerID}" />

            </DataGrid.Columns>

            <DataGrid.RowDetailsTemplate>
                <DataTemplate>
                    <Border Margin="5" Padding="3" BorderBrush="DarkBlue" BorderThickness="3" CornerRadius="5" Background="LightGray">
                        <StackPanel Orientation="Vertical">
                            <TextBlock Foreground="Black" FontWeight="Bold" FontSize="14" Text="Lieferdetails:"/>
                            <TextBlock Foreground="DarkBlue" FontWeight="Bold" Text="{Binding ShipAddress}" />
                            <TextBlock Foreground="DarkBlue" FontWeight="Bold" Text="{Binding ShipCity}"/>
                            <TextBlock Foreground="DarkBlue" FontWeight="Bold" Text="{Binding ShipCountry}"/>
                        </StackPanel>
                    </Border>
                </DataTemplate>
            </DataGrid.RowDetailsTemplate>
        </DataGrid>
    </Grid>
</Window>
