Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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...
Posted
Updated 13-Aug-12 2:20am
v2

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:
XML
title='<%# Bind("Comments_Column_Name")>' tooltip='<%# Bind("Comments_column_name")>'


Comments_Column_Name is the name of your column as you explain on your question =)

Hope you can find it useful.
 
Share this answer
 
v3
Comments
Christian Amado 13-Aug-12 8:17am    
Sorry. Typing problem. Tooltip only works on IE. Title works in any other browser.
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>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900