我有一个显示网格工具提示的问题。
这是我的代码:
<dxg:GridControl.View>
<dxg:CardView x:Name="viewAgreementMonitoring" ShowTotalSummary="True" ShowSearchPanelMode="Always" ShowGroupPanel="False" >
<dxg:CardView.CardHeaderTemplate>
<DataTemplate>
<Grid >
<Grid.Style>
<Style TargetType="{x:Type Grid}">
<Setter Property="ToolTip">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToolTip}">
<StackPanel>
<TextBlock>txt1</TextBlock>
<TextBlock>
Red: The Contractdurationend is expired
Yellow: The Contractdurationend will expire in less than 12 Months
Green: The Contractdurationend takes place in more than 12 Months
</TextBlock>
<Label Content="{Binding vesselID}" ContentStringFormat="VesselID: {0}" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Style>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="{Binding Data.vesselDescription}" Background="{Binding Data.background}" Foreground="Black" FontWeight="Bold" Grid.Row="0"/>
<Label Content="{Binding Data.vesselCustomer}" Background="{Binding Data.background}" Grid.Row="1"/>
</Grid>
</DataTemplate>
</dxg:CardView.CardHeaderTemplate>
当我运行应用程序时,Grid-Tooltip 显示:
“System.Windows.Controls.ControlTemplate”
我的代码中的错误在哪里?