<DataGridTemplateColumn Header="发生时间" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding OccurTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" FontSize="10" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
- <DataTemplate x:Key="DateTemplate" >
- <StackPanel Width="40" Height="30">
- <Border Background="Orange" BorderBrush="Black" BorderThickness="1">
- <TextBlock Text="{Binding ExamDate, StringFormat={}{0:MM-dd}}"
- FontSize="10" HorizontalAlignment="Center"/>
- </Border>
- <Border Background="White" BorderBrush="Black" BorderThickness="1">
- <TextBlock Text="{Binding ExamDate, StringFormat={}{0:yyyy}}"
- FontSize="10" HorizontalAlignment="Center"/>
- </Border>
- </StackPanel>
- </DataTemplate>
- <DataGridTemplateColumn Header="Exam Date"
- CellTemplate="{StaticResource DateTemplate}"
- CellEditingTemplate="{StaticResource EditingDateTemplate}"/>