Xaml 如何在DataGrid中设置行标题列的样式

Xaml 如何在DataGrid中设置行标题列的样式,xaml,datagrid,styling,rowdetails,Xaml,Datagrid,Styling,Rowdetails,我使用的是ComponentOne C1DataGrid。除了行标题列之外,我已经能够对它进行完整的样式设置 如何在XAML中设置样式 您可以看到以下图像: 谢谢 flot回答我自己的问题,以防其他人感兴趣: 有一个特殊的演示者DataGridRowHeaderPresenter,可以设置样式。 我想用像“+”和“-”这样的树形符号替换标准的行详细信息切换,具体操作如下: <Style x:Key="DataGridRowHeaderStyle2" TargetType="{x:T

我使用的是ComponentOne C1DataGrid。除了行标题列之外,我已经能够对它进行完整的样式设置

如何在XAML中设置样式

您可以看到以下图像: 谢谢
flot

回答我自己的问题,以防其他人感兴趣:

有一个特殊的演示者DataGridRowHeaderPresenter,可以设置样式。 我想用像“+”和“-”这样的树形符号替换标准的行详细信息切换,具体操作如下:

    <Style x:Key="DataGridRowHeaderStyle2" TargetType="{x:Type c1:DataGridRowHeaderPresenter}">
    <Setter Property="FontWeight" Value="Bold" />
    <Setter Property="FontSize" Value="12" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type c1:DataGridRowHeaderPresenter}">
                <!-- BulletDecorator is used to provide baseline alignment between the sign and the Content -->
                <BulletDecorator Background="#BFEFF2F5">
                    <BulletDecorator.Bullet>
                        <Grid Width="13" Height="13">
                            <Image Name="sign" Source="/myControls;component/Resources/Images/plus.png" />
                        </Grid>
                    </BulletDecorator.Bullet>
                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
                </BulletDecorator>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsSelected" Value="true">
                        <Setter Property="Source"  Value="/myControls;component/Resources/Images/minus.png"  TargetName="sign"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

如果其他人感兴趣,请回答我自己的问题:

有一个特殊的演示者DataGridRowHeaderPresenter,可以设置样式。 我想用像“+”和“-”这样的树形符号替换标准的行详细信息切换,具体操作如下:

    <Style x:Key="DataGridRowHeaderStyle2" TargetType="{x:Type c1:DataGridRowHeaderPresenter}">
    <Setter Property="FontWeight" Value="Bold" />
    <Setter Property="FontSize" Value="12" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type c1:DataGridRowHeaderPresenter}">
                <!-- BulletDecorator is used to provide baseline alignment between the sign and the Content -->
                <BulletDecorator Background="#BFEFF2F5">
                    <BulletDecorator.Bullet>
                        <Grid Width="13" Height="13">
                            <Image Name="sign" Source="/myControls;component/Resources/Images/plus.png" />
                        </Grid>
                    </BulletDecorator.Bullet>
                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
                </BulletDecorator>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsSelected" Value="true">
                        <Setter Property="Source"  Value="/myControls;component/Resources/Images/minus.png"  TargetName="sign"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>