0

I have a RadGridView and for one column/Cell of Grid, I want to change it's default "Part_CellBorder" style. I tried many things but I am not getting the proper way to do that.

Can anyone suggest what would be the proper way to dynamically change the style of Part_CellBorder (BorderThickness). Because I don't want to create separate style for this.

4

1 回答 1

0

恐怕您不能在PART_CellBorder不为单元格创建完整自定义的情况下修改元素ControlTemplate,即您将复制整个默认值ControlTemplate,然后根据您的要求对其进行编辑。

另一种选择是尝试在运行时以编程方式获取对PART_CellBorder元素的引用,然后通过设置其任何属性来修改它。但是没有办法只覆盖 a 的一部分ControlTemplate

WPF:有没有办法在不重新定义整个样式的情况下覆盖 ControlTemplate 的一部分?

于 2019-01-09T12:18:03.443 回答