来自数据库的gridview工具提示 [英] tooltip of gridview from database
问题描述
嗨...
我有一个名为"Customers"的gridview.它包含5个名为
的BoundField列
1)custmer_id,
2)名称
3)项目
4)日期
5)费率
Rate包含从1到5的数字.当我将鼠标放在这些值上时,它应该在工具提示中显示注释(可以从数据库中加载注释.数据库包含一列名为Comments的列).
我该怎么办?请有人帮助我...
Hi...
i have one gridview named "Customers".it contain 5 BoundField columns named
1)custmer_id,
2)Name
3)Item
4)Date
5)Rate
Rate contain numbers from 1 to 5.when i place mouse over these values it should show comments(comments can be loaded from database.Database contain one column named Comments) in tooltip.
How can i do this one? Someone please help me...
推荐答案
将费率"列创建为模板.在模板内部放置一个控件(您需要的任何控件,例如AJAX工具包中的评级控件)
因此,将标题和/或工具提示属性分配给:
Create your Rate Column as a Template. Inside the template put a control (anyone that you need. E.g Rating control from AJAX Toolkit)
So assign the title and/or tooltip property to:
title='<%# Bind("Comments_Column_Name")>' tooltip='<%# Bind("Comments_column_name")>'
Comments_Column_Name 是您在问题上解释的列的名称=)
希望您会发现它有用.
Comments_Column_Name is the name of your column as you explain on your question =)
Hope you can find it useful.
尝试一下:
Try this :
<asp:templatefield xmlns:asp="#unknown">
<itemtemplate>
<asp:linkbutton id="link1" runat="server" commandname="link" forecolor="Blue" tooltip="<%# String.Format("Comment for item :{0}", Eval("comment"))%>"> <%#Eval("item")%></asp:linkbutton>
</itemtemplate>
use :
ToolTip=''<%# String.Format("Comment for item :{0}", Eval("comment"))%>''
hope this will help you...
if not please post it....</asp:templatefield>
这篇关于来自数据库的gridview工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!