2
我試圖將一個gridViewColumn分隔成兩行。我使用listView的默認樣式。將列標題分隔成兩行沒有問題,但好像內容被放在原始樣式上,並且邊界等隱藏在我的自定義gridViewHeader內容下。代碼如下:WPF:Split GridView標題分成兩行,其中最下面一行分爲兩列。
<GridViewColumnHeader>
<GridViewColumnHeader.Template>
<ControlTemplate>
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid ShowGridLines="False" VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="SomeHeaderText" HorizontalAlignment="Center"/>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="SubHeaderText1" Padding="5" HorizontalAlignment="Center" />
<TextBlock Grid.Column="1" Text="SubHeaderText1" Padding="5" HorizontalAlignment="Center" />
</Grid>
</Grid>
</Grid>
</ControlTemplate>
</GridViewColumnHeader.Template>
</GridViewColumnHeader>
任何人知道如何cutomized的GridViewHeader像這樣的例子並保持GridViewHeader的外觀