<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
>
<Grid>
<DataGrid AutoGenerateColumns="false" x:Name="grid" Width="100" Height="100" LoadingRow="grid_LoadingRow" FrozenColumnCount="2" Margin="26,10,391,209" >
<DataGrid.Columns>
<DataGridComboBoxColumn/>
<DataGridHyperlinkColumn Header="RoleID" Width="100" Binding="{Binding Path=RoleID}">
</DataGridHyperlinkColumn>
<DataGridTextColumn Header="RoleName" Width="100" Binding="{Binding Path=RoleName}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"></Setter>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Description" Width="100" Binding="{Binding Path=Description}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"></Setter>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridComboBoxColumn Header="RoleName" SelectedItemBinding="{ Binding Path=RoleName}">
<DataGridComboBoxColumn.ItemsSource>
<col:ArrayList>
<sys:String>a</sys:String>
<sys:String>b</sys:String>
<sys:String>c</sys:String>
</col:ArrayList>
</DataGridComboBoxColumn.ItemsSource>
</DataGridComboBoxColumn>
</DataGrid.Columns>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<Border Margin="5">
<TextBlock Text="{ Binding Path=Description}" TextWrapping="Wrap"></TextBlock>
</Border>
</DataTemplate>
</DataGrid.RowDetailsTemplate>
</DataGrid>
<DataGrid HorizontalAlignment="Left" Margin="195,86,0,0" Name="grid2" VerticalAlignment="Top" Height="190" Width="312">
<DataGrid.Columns>
<DataGridTemplateColumn Header="date">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DateTime}"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<DatePicker SelectedDate="{Binding Path=DateTime,Mode=TwoWay}"></DatePicker>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="DateTime">
<DataGridTextColumn.Binding>
<Binding Path="DateTime" StringFormat="{}{0:yyyy-MM-dd HH:mm:ss}">
<Binding.ValidationRules>
</Binding.ValidationRules>
</Binding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Window>