<Window x:Class="WpfObjectProviderWithLinqToSql.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:local="clr-namespace:WpfObjectProviderWithLinqToSql"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:xlinq="clr-namespace:System.Xml.Linq;assembly=System.Xml.Linq"
    Title="Window1" 
    Height="600" Width="800">
    <Grid>
        <telerik:RadGridView Name="RadGridView1" AutoGenerateColumns="False"
            IsReadOnly="True" telerik:Theming.Theme="Vista" ColumnsWidthMode="Fill" >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn HeaderText="CustomerID" DataMemberPath="CustomerID"/>
                <telerik:GridViewDataColumn HeaderText="CompanyName" DataMemberPath="CompanyName"/>
                <telerik:GridViewDataColumn HeaderText="ContactName" DataMemberPath="ContactName"/>
                <telerik:GridViewDataColumn HeaderText="ContactTitle" DataMemberPath="ContactTitle"/>
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.GroupDescriptions>
                <telerik:RadGroupDescription PropertyName="Country"></telerik:RadGroupDescription>
            </telerik:RadGridView.GroupDescriptions>
            <telerik:RadGridView.Resources>
                <Style TargetType="{x:Type telerik:GridViewRow}">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type telerik:GridViewRow}">
                                <Border HorizontalAlignment="Left" Margin="0,0,0,0" Background="{TemplateBinding Background}">
                                    <Border Margin="0,0,0,0" x:Name="SelectedRow" VerticalAlignment="Top" Opacity="1" BorderThickness="0,1,0,1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition />
                                                <RowDefinition />
                                            </Grid.RowDefinitions>
                                            <telerik:NavigationPresenter Grid.Row="0" />
                                            <telerik:DataCellsPresenter Grid.Row="0" MinHeight="22" x:Name="PART_DataCellsPresenter" Grid.Column="1" />

                                            <GroupBox Name="GroupBox" Visibility="Collapsed" Header="Details:" Grid.Row="1" Grid.Column="1" Margin="10">
                                                <StackPanel>
                                                    <StackPanel Orientation="Horizontal">
                                                        <Label Width="50">City</Label>
                                                        <Label>:</Label>
                                                        <ContentControl  VerticalAlignment="Center" Content="{Binding City}" />
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal">
                                                        <Label Width="50">Country</Label>
                                                        <Label>:</Label>
                                                        <ContentControl VerticalAlignment="Center" Content="{Binding Country}" />
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal">
                                                        <Label Width="50">Address</Label>
                                                        <Label>:</Label>
                                                        <ContentControl VerticalAlignment="Center" Content="{Binding Address}" />
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal">
                                                        <Label Width="50">Phone</Label>
                                                        <Label>:</Label>
                                                        <ContentControl VerticalAlignment="Center" Content="{Binding Phone}" />
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal">
                                                        <Label Width="50">Fax</Label>
                                                        <Label>:</Label>
                                                        <ContentControl VerticalAlignment="Center" Content="{Binding Fax}" />
                                                    </StackPanel>
                                                </StackPanel>
                                            </GroupBox>
                                            
                                        </Grid>
                                    </Border>
                                </Border>
                                <ControlTemplate.Triggers>
                                    <MultiTrigger>
                                        <MultiTrigger.Conditions>
                                            <Condition Property="IsSelected" Value="True" />
                                            <Condition Property="IsCurrent" Value="True" />
                                        </MultiTrigger.Conditions>
                                        <Setter Property="Visibility" TargetName="GroupBox" Value="Visible" />
                                        <Setter Property="Background" TargetName="GroupBox" Value="AliceBlue"/>
                                        <Setter Property="BorderBrush" TargetName="GroupBox" Value="Navy"/>
                                    </MultiTrigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </telerik:RadGridView.Resources>
        </telerik:RadGridView>
    </Grid>
</Window>
