Telerik UI为WPF吗?免费下载30天试用版

样式组页脚

在阅读这个主题之前,您可能会发现它有用的熟悉GridViewGroupFooterCell和GridViewGroupFooterRow

在本文中,我们将讨论下列主题:

针对GridViewGroupFooterRow元素

如果你想风格应用程序的所有组页脚行,您应该创建一个适当的风格定位GridViewGroupFooterRow元素。

图1:GridViewGroupFooterRow模板结构

Telerik WPF DataGrid-groupfooterrow-style

你有两个选择:

  • 创建一个空的风格和自己设置它。

  • 复制的默认样式控制和修改它。

学习如何修改默认GridViewFooterCell样式,请参考修改默认样式篇文章。

示例1:样式应用程序的所有组页脚行

<风格TargetType = " telerik: GridViewGroupFooterRow " > < Setter属性=“前景”价值= "白色" / > < Setter属性= "背景" Value = " LightBlue " / > < /风格>

如果您正在使用隐式风格,你应该基于你的风格GridViewGroupFooterRowStyle

设置RadGridView的GroupFooterRowStyle

RadGridView的页脚行也可以通过创建一个适当的风格风格GridViewGroupFooterRow像RadGridView元素和设置它GroupFooterRowStyle财产。

示例2:设置RadGridView GroupFooterRowStyle

< telerik: RadGridView GroupFooterRowStyle = " {StaticResource GridViewFooterRowStyle} " / >

图2:RadGridView与样式组页脚行

Telerik WPF DataGrid-groupfooterrow-styled

设置RadGridView的GroupFooterRowStyleSelector

你也可以使用RadGridView的GroupFooterRowStyleSelector属性组页脚行不同风格基于一个特定的条件。更多细节可以找到如何实现这个GroupFooterRowStyleSelector文章

针对GridViewGroupFooterCell元素

为了所有的风格RadGridView细胞的应用程序,您应该创建一个适当的风格定位GridViewGroupFooterCell元素。

示例6:样式应用程序的所有组页脚细胞

<风格TargetType = " telerik: GridViewGroupFooterCell " > < Setter属性= " BorderBrush " Value = "红色" / > < Setter属性= "背景" Value = "蓝色" / > < /风格>

如果您正在使用隐式风格,你应该基于你的风格GridViewGroupFooterCellStyle

设置列的GroupFooterCellStyle

RadGridView页脚细胞也可以通过创建一个适当的风格风格GridViewGroupFooterCell元素和设置GroupFooterCellStyle各自的属性GridViewColumn

示例7:设置一个列的GroupFooterCellStyle

< telerik: GridViewDataColumn DataMemberBinding = "{绑定名称}”头=“名称”GroupFooterCellStyle = " {StaticResource GridViewFooterCellStyle} " / >

图2:RadGridView与样式组页脚细胞

Telerik WPF DataGrid样式和模板样式GridViewFooterCell 03

设置列的GroupFooterCellStyleSelector

你也可以使用RadGridView的GroupFooterCellStyleSelector属性组页脚行不同风格基于一个特定的条件。更多细节可以找到如何实现这个GroupFooterCellStyleSelector文章

另请参阅

在这篇文章中
Baidu
map