编辑XamDataGrid标头

时间:2013-07-10 01:02:25

标签: c# infragistics xamdatagrid

我想编辑一个xamdatagrid,看起来像这个

|更新|
|通过|失败了|
| 1 | 0 |
| 0 | 1 |
(我的间距很差,但你明白了) 我想在xamdatagrid上设置此模板并将其绑定到数据集。 这可能吗?如果有可能我在哪里可以找到c#中的一个好例子?我一直在寻找不完整的例子。

1 个答案:

答案 0 :(得分:2)

您需要创建字段LabelPresenterStyle

<Style TargetType="{x:Type igWPF:LabelPresenter}" x:Key="PassedFailedLabelPresenterStyle">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type igWPF:LabelPresenter}">
                <TextBlock HorizontalAlignment="Center" Text="passed | failed" VerticalAlignment="Center" />
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

并像

一样使用它
<igWPF:Field Name="Hired" Width="Auto" LabelPresenterStyle="{StaticResource PassedFailedLabelPresenterStyle}">
相关问题