【问题标题】:wpf ViewBox - when scaling a DataGrid, the Grid lines are missingwpf ViewBox - 缩放 DataGrid 时,缺少网格线
【发布时间】:2011-02-17 11:06:13
【问题描述】:

我有一个 WPF Toolkit DataGrid 控件,包含在一个 Grid 中,一个 ViewBox 控件中。 DataGrid 有自己的风格,黑色背景、白色文本和白色网格线。

某些网格线在网格中丢失(字面意思)显示时,通常在 DataGrid 中有 10 行或更多行时。当我移除 ViewBox 时,它可以正常工作(但我需要缩放,因此需要使用 ViewBox)。

我还没有设置很多viewbox的属性:

<Viewbox Stretch="Uniform" StretchDirection="Both">

是否需要设置其他属性才能正确缩放 DataGrid?还是因为 DataGrid 有自己的自定义样式?

非常感谢

【问题讨论】:

  • 您能发布一些重现此行为的 xaml 吗?它似乎对我有用
  • 感谢 Meleak,现在已修复。这是一个增加 DataGridCells 边框大小的案例。

标签: wpf wpf-controls


【解决方案1】:

增加了 DataGrid 自定义样式中 DataGridCells 的边框大小。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-11-30
    • 1970-01-01
    • 2015-10-06
    • 2011-07-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-22
    相关资源
    最近更新 更多