• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 783
  • Last Modified:

ASP.NET - add tooltips to GridView

I've got a situation where I'm binding a DataTable to a GridView.  In the resulting table are a bunch of scores and for each score in the table I need there to be a tooltip displayed on hover that shows that date of that score.

What I tried to do was to edit the DataTable that I was binding to the GridView control so that each field with score text was changed to have the text surrounded with a span tag which had a title of the date.  The result of this effort was that the entire span tag was printed out in the table cell.

Is there anyway to configure the GridView so that it doesn't encode the characters < and > to &lt; and &gt; when the control renders?

Or is there any other way to get at what I'm trying to do?
2 Solutions
Refer below example (to display a single information)
In your HeaderText, do this:

HeaderText="<span title='Document Size'>Size</span>"

Here's it is in context:

<asp:BoundColumn DataField="DocS" HeaderText="<span title='Document Size'>Size</span>" > 
Look at the demo here : http://www.mosesofegypt.net/samples00/GridViewJquerytooltip/
If you wna to do same as demo refer link :http://mosesofegypt.net/post/2008/03/Displaying-Row-Details-Tooltip-on-GridView-using-JQuery.aspx
Also by web services, this is possible Refer http://www.dotnetbips.com/articles/36f06160-5221-4d27-a177-320927f4b962.aspx

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now