【问题标题】:Underlining the WPF datagrid headers下划线 WPF 数据网格标题
【发布时间】:2009-04-07 09:07:27
【问题描述】:

我有一个非常愚蠢的问题要问你.. :P 如何在 DataGrid 标题下划线??

【问题讨论】:

    标签: wpf wpftoolkit


    【解决方案1】:
     <Window 
    x:Class="Test.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dg="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
    xmlns:dgp="clr-namespace:Microsoft.Windows.Controls.Primitives;assembly=WPFToolkit"
    Title="Window1" Height="300" Width="300">
    <Window.Resources>
        <Style TargetType="dgp:DataGridColumnHeader">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="dgp:DataGridColumnHeader">
                        <Label>
                            <Underline>
                                <ContentPresenter/>
                            </Underline>
                        </Label>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <dg:DataGrid>
            <dg:DataGrid.Columns>
                <dg:DataGridTextColumn Header="No." Width="50">
                </dg:DataGridTextColumn>
            </dg:DataGrid.Columns>
        </dg:DataGrid>
    </Grid>
    </Window>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-19
      • 1970-01-01
      • 2014-03-21
      • 1970-01-01
      • 2015-09-20
      • 2011-07-09
      • 1970-01-01
      • 2017-06-11
      相关资源
      最近更新 更多