Silverlight DataGrid 数据绑定鼠标移入到内容项时显示类似ToolTip提示文本

Silverlight DataGrid 数据绑定鼠标移入到内容项时显示类似ToolTip提示文本,第1张

概述效果图如下:   主要是调用ToolTipService.ToolTip属性 主要代码如下:                                <sdk:DataGrid Margin="4,36,8,7" DataContext="{Binding}" IsReadOnly="True" AutoGenerateColumns="False" x:Name="dg" Selectio

效果图如下:

 

主要是调用tooltipService.tooltip属性

主要代码如下:

                               <sdk:DataGrID margin="4,36,8,7" DataContext="{Binding}" IsReadonly="True" autoGenerateColumns="False" x:name="dg" SelectionChanged="dg_SelectionChanged" FontSize="14.667" FontFamily="Microsoft YaHei" LoadingRow="dg_LoadingRow" VerticalScrollbarVisibility="auto" HorizontalScrollbarVisibility="HIDden" d:LayoutOverrIDes="Horizontalmargin">
                                        <sdk:DataGrID.Columns>

                                            <sdk:DataGrIDTemplateColumn header="序号"  WIDth="50" headerStyle="{StaticResource aheaderStyle}">
                                                <sdk:DataGrIDTemplateColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <TextBlock TextAlignment="Center"  VerticalAlignment="Center">
                                                             <tooltipService.tooltip>
                                                                    <StackPanel OrIEntation="Horizontal">
                                                                        <TextBlock Text="{Binding name}" Foreground="Red"  VerticalAlignment="Center"></TextBlock>
                                                                    </StackPanel>
                                                              </tooltipService.tooltip>
                                                        </TextBlock>
                                                    </DataTemplate>
                                                </sdk:DataGrIDTemplateColumn.CellTemplate>
                                            </sdk:DataGrIDTemplateColumn>

                                            <sdk:DataGrIDTemplateColumn header="工程名称"  WIDth="200" headerStyle="{StaticResource aheaderStyle}">
                                                <sdk:DataGrIDTemplateColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <TextBlock FontSize="14.667" Text="{Binding name}"   HorizontalAlignment="left" VerticalAlignment="Center">
                                                              <tooltipService.tooltip>
                                                                    <StackPanel OrIEntation="Horizontal">
                                                                        <TextBlock Text="{Binding name}" Foreground="Red"  VerticalAlignment="Center"></TextBlock>
                                                                    </StackPanel>
                                                              </tooltipService.tooltip>
                                                        </TextBlock>
                                                    </DataTemplate>
                                                </sdk:DataGrIDTemplateColumn.CellTemplate>
                                            </sdk:DataGrIDTemplateColumn>

                                        </sdk:DataGrID.Columns>                                    </sdk:DataGrID>

总结

以上是内存溢出为你收集整理的Silverlight DataGrid 数据绑定鼠标移入到内容项时显示类似ToolTip提示文本全部内容,希望文章能够帮你解决Silverlight DataGrid 数据绑定鼠标移入到内容项时显示类似ToolTip提示文本所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1021617.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存