Avatar of cynx
cynxFlag for India

asked on 

GridView Headers tooltip using jQuery

I have a requirement to display tooltips for gridview (asp)  headers, (using jQuery with its custom CSS) which is in user control.
When applied the tooltip displays with its CSS but the original CSS for the grid is lost.

Sample code below (what I implemented)

The tooltips for the headers is set in code behind row-data bound event.
Any idea why the original CssClass="Grid" is being overwritten?
(When I remove the jQuery, CSS comes fine.)

<script type="text/javascript" src="JS/jquery.tools.min.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
    $("#grd [title]").tooltip({
        offset: [0, 20],
        effect: 'slide',        
        relative: true

    });
    });

</script>
</head>

<body>
<table>
<tr>
<td> 
<div id="grd">
<asp:GridView ID="GridView1" runat="server" CssClass="Grid">
    </asp:GridView>
</div>
</td>
</tr>
</table>
</body>

<style type="text/css">
.tooltip {
    display:none;
    background-color:Black;
    color:White;
    font-size:14px;
    border-style:outset;
    height:50px;
    width:160px;
   }
</style>

Open in new window

jQueryJavaScriptASP.NET

Avatar of undefined
Last Comment
Jon Norman
ASKER CERTIFIED SOLUTION
Avatar of Jon Norman
Jon Norman
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo