我有以下ControlTemplate
,我将指定其中的重要部分
<ControlTemplate x:Key="GridViewRowTemplate" TargetType="grid:GridViewRow">
...
<ControlTemplate x:Key="GridViewRowTemplate" TargetType="grid:GridViewRow">
<Border x:Name="Background_Over"
Background="{TemplateBinding MouseOverBackground}"
Margin="0 0 0 1"
Grid.Column="0"
Grid.ColumnSpan="4"
Visibility="Collapsed"
grid:SelectiveScrollingGrid.SelectiveScrollingClip="True"/>
<Border x:Name="Background_Selected"
Background="{TemplateBinding SelectedBackground}"
Margin="0 0 0 1"
Grid.Column="0"
Grid.ColumnSpan="4"
Visibility="Collapsed"
grid:SelectiveScrollingGrid.SelectiveScrollingClip="True"/>
...
</ControlTemplate>
我想在边界Background_Over
中插入以下网格,当MouseOver触发。
<Grid>
<TextBlock Text="Example"/>
</Grid>
我想在特定的上做这个显示数据表格
<telerik:RadGridView>
...
</telerik:RadGridView>
感谢您的帮助
我会用via样式声明修改后的模板,然后通过RowStyle
属性传递它,像这样:
<Grid>
<Grid.Resources>
<Style x:Key="ModifiedTemplateRowStyle" TargetType="grid:GridViewRow">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="grid:GridViewRow">
. . .
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<telerik:RadGridView RowStyle="{StaticResource ModifiedTemplateRowStyle}">
. . .
</telerik:RadGridView>
</Grid>