GridView 中的工具提示 [英] Tooltip in GridView

查看:21
本文介绍了GridView 中的工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 gridView 列中包含工具提示的最简单方法是什么?

What is the easiest way to include a tooltip in the gridView column?

例如本专栏

<asp:BoundField DataField="short_comment" HeaderText="Comments" ReadOnly="True" SortExpression="short_comment"/>

我想要类似的东西

<asp:BoundField DataField="short_comment" ToolTipDataField="longer_comment"/>

显然 ToolTipDataField 不存在,但实现该功能的最简单方法是什么?

Obviously the ToolTipDataField does not exist, but what would be the easiest way to achieve that functionality?

推荐答案

替换为模板

<asp:TemplateField HeaderText="Comments" SortExpression="short_comment">
     <ItemTemplate>
         <asp:Label ID="Label1" runat="server" Text='<%# Bind("short_comment") %>' ToolTip ='<%# Bind("longer_comment") %>'></asp:Label>
     </ItemTemplate>
</asp:TemplateField>

这篇关于GridView 中的工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆