如何显示gridview单元格的工具提示? [英] how to show a tooltip for gridview cell?
本文介绍了如何显示gridview单元格的工具提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何显示asp.net gridview单元格的工具提示?
例如,
名称
学生1
学生3
学生4
如果鼠标悬停Student1然后我想要将工具提示显示为Student1
how to show a tooltip for asp.net gridview cell?
Example,
Name
Student1
Student3
Student4
if mouse hover Student1 then i want to display tooltip as a Student1
推荐答案
Following is the code for use in the Frontend /markup.
<asp:TemplateField HeaderText="Description"
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Left(Eval("Description"),20) %>'
tooltip='<%# Eval("Description") %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
This can be done using Codebehind from the RowDataBound event of the GridView
你可以使用模板列来完成它,如下所示:
you can do it using template column as shown below :
<asp:GridView runat="server" ID="gridMain" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<div title='<%#Eval("StudentName") %>'>
<%#Eval("StudentName") %>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
请参阅:在asp.net的gridview单元格中的工具提示 [ ^ ]
问候..
See this: Tooltip in gridview cell in asp.net[^]
Regards..
这篇关于如何显示gridview单元格的工具提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文