Asp.net GridView中的工具提示

Asp.net GridView中的工具提示,asp.net,gridview,Asp.net,Gridview,在gridView列中包含工具提示的最简单方法是什么 例如在本专栏中 <asp:BoundField DataField="short_comment" HeaderText="Comments" ReadOnly="True" SortExpression="short_comment"/> 我想要点像这样的 <asp:BoundField DataField="short_comment" ToolTipDataField="longer_comment"/>

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

例如在本专栏中

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

我想要点像这样的

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

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

替换为模板

<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>

e.Row.Cells[7]。工具提示=e.Row.Cells[7]。文本

我做了一些类似的事情,似乎奏效了。我要做的是将单元格的内容显示为工具提示。你可以在这里放一些较长的评论

我从暗中处理了这件事。不确定这是最好的解决方案

希望能有帮助