Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip in GridView

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

For example in this column

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

I would like to have something like

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

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

like image 680
kristof Avatar asked Dec 13 '22 19:12

kristof


1 Answers

Replaced with template

<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>
like image 143
kristof Avatar answered Dec 30 '22 22:12

kristof