如题!刚学C#
网上搜了一下有教程,但是按照教程写的会让整个ListView数据居中显示,我想就指定某一列的数据居中显示该怎么写。
<ListView x:Name="ListView_Watermark" HorizontalAlignment="Left" Height="423" Margin="10,10,0,0" VerticalAlignment="Top" Width="908">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView>
<GridViewColumn Header="序号" Width ="60" DisplayMemberBinding ="{Binding Number}"/>
<GridViewColumn Header="文件名" Width="650" DisplayMemberBinding ="{Binding FileName}"/>
<GridViewColumn Header="页数" Width="80" DisplayMemberBinding="{Binding Pages}"/>
<GridViewColumn Header="文件大小" Width="90" DisplayMemberBinding ="{Binding FileSize}"/>
</GridView>
</ListView.View>
</ListView>