Styling the Xceed ColumnManagerCell

倖福魔咒の 提交于 2019-12-04 21:16:37

You should use a border instead of the grid and then hook up the template bindings for the border like this:

<Style TargetType="{x:Type xcdg:ColumnManagerCell}">
    <Setter Property="Background" Value="LightGray" />
    <Setter Property="BorderBrush" Value="#c5c5c5"/>
    <Setter Property="BorderThickness" Value="1,1,1,1"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="ContentControl">
                <Border Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}">
                    <ContentPresenter Content="{TemplateBinding ContentControl.Content}"
                                    ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
                                    ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" />
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

I should mention that my default ControlTemplate for ColumnManagerCell is a ContentPresenter instead of DataCell like below:

<xcdg:DataCell Content="{TemplateBinding Content}" />

Are you sure your using the correct control template?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!