fork download
  1. <Window x:Class="WpfApplication1.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. Title="MainWindow" Height="350" Width="525">
  5. <Grid>
  6. <DataGrid AutoGenerateColumns="False" Height="200" HorizontalAlignment="Left" Margin="35,12,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="200">
  7. <DataGrid.Columns>
  8. <DataGridTemplateColumn Header="Header" Width="*">
  9. <DataGridTemplateColumn.HeaderTemplate>
  10. <DataTemplate>
  11. <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
  12. <TextBlock VerticalAlignment="Center" Text="左" />
  13. <TextBlock VerticalAlignment="Center" Text="中" />
  14. <TextBlock VerticalAlignment="Center" Text="右" />
  15. </StackPanel>
  16. </DataTemplate>
  17. </DataGridTemplateColumn.HeaderTemplate>
  18. </DataGridTemplateColumn>
  19.  
  20.  
  21. <DataGridTemplateColumn Header="Header" Width="*">
  22. <DataGridTemplateColumn.HeaderTemplate>
  23. <DataTemplate>
  24. <Grid VerticalAlignment="Center">
  25. <Grid.ColumnDefinitions>
  26. <ColumnDefinition Width="*"/>
  27. <ColumnDefinition Width="*"/>
  28. <ColumnDefinition Width="*"/>
  29. </Grid.ColumnDefinitions>
  30. <TextBlock Grid.Column="0" VerticalAlignment="Center" Text="左" />
  31. <TextBlock Grid.Column="1" VerticalAlignment="Center" Text="中" />
  32. <TextBlock Grid.Column="2" VerticalAlignment="Center" Text="右" />
  33. </Grid>
  34. </DataTemplate>
  35. </DataGridTemplateColumn.HeaderTemplate>
  36. </DataGridTemplateColumn>
  37. </DataGrid.Columns>
  38. </DataGrid>
  39. </Grid>
  40. </Window>
  41.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty