【问题标题】:edit XamDataGrid header编辑 XamDataGrid 标头
【发布时间】:2013-07-10 01:02:25
【问题描述】:

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

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

【问题讨论】:

标签: c# infragistics xamdatagrid


【解决方案1】:

您需要创建字段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}">

【讨论】:

  • 你能提供一个c#的例子吗?
  • 样式放在哪里?你能把这个例子的完整 xaml 放上去吗?
  • 你需要把它放在你的页面xaml资源标签中。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-10-15
相关资源
最近更新 更多