tags:

views:

340

answers:

1

Hi all,

I have very silly question to ask you.. :P how can I underline the DataGrid headers ??

+1  A: 
 <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>
Stanislav Kniazev