Bind the gridview column to implement the tooltip Function
Method 1 introduce the Javascript script Library
Add
<SCRIPT type = "text/JavaScript" src = "~ /Script/wz_tooltip.js "> </SCRIPT>
<SCRIPT type = "text/JavaScript" src = "~ /Script/tip_balloon.js "> </SCRIPT>
<SCRIPT type = "text/JavaScript" src = "~ /Script/tip_center1_1_js "> </SCRIPT>
Convert columns into template columns and add them
<ASP: hyperlinkId = "hlcid" runat = "server" navigateurl = '<% # "javascript: OpenWindow (\"~ /Getshopcard. aspx? O = view & SID = "+ eval (" Sid "). tostring () + "\"); "%> 'text = '<% # BIND (" cardid ") %>'Onmouseover= "Tagtotip ('T2tballoon', Balloon, true, fadein, 400, fadeout, 400, abve, true,Width: 260, Padding, 8, textalign, 'left', offsetx,-10) "/>
<ASP: LabelRunat = "server" id ="T2tballoon"Style =" display: none "> <% = resources. companys. shoprunscope %> <B> <% # eval ("runscope") + "\ n \ t" %> </B> <br/> <% = resources. companys. shopplace %> <B> <% # eval ("place") %> </B> </ASP: Label>
In the backgroundCodeAdd this method
Protected Void Gv1_holder_rowdatabound ( Object Sender, gridviewroweventargs E)
{
If (E. Row. rowtype = Datacontrolrowtype. datarow)
{
Try
{
Hyperlink lblname = (Hyperlink) E. Row. findcontrol ( " Hlcid " );
Label lblt2tballoon = (Label) E. Row. findcontrol ( " T2tballoon " );
Lblname. Attributes. Add ( " Onmouseover " , " Tagtotip (' " + Lblt2tballoon. clientid + " ', Balloon, true, fadein, 400, fadeout, 400, above, true, width, 260, padding, 8, textalign, 'left', offsetx,-10) " );
}
Catch (Exception)
{
Throw;
}
}
}
/* Protected Void Gvevents_rowdatabound ( Object Sender, gridviewroweventargs E)
{
If (E. Row. rowtype = Datacontrolrowtype. datarow)
{
E. Row. Attributes. Add ( " Onmouseover " , " Currentbackgroundcolor = This. style. backgroundcolor; currentcolor = This. style. color; this. style. backgroundcolor = 'red'; this. style. Color = 'white' " );
E. Row. Attributes. Add ( " Onmouseout " , " This. style. backgroundcolor = currentbackgroundcolor; this. style. Color = currentcolor " );
E. Row. attributes [ " Style " ] = " Cursor: Hand " ;
Try
{
Label lblname = (Label) E. Row. findcontrol ( " Labelusername " );
Label lblt2tballoon = (Label) E. Row. findcontrol ( " T2tballoon " );
Lblname. Attributes. Add ( " Onmouseover " , " Tagtotip (' " + Lblt2tballoon. clientid + " ', Balloon, true, fadein, 400, fadeout, 400, above, true, width, 260, padding, 8, textalign, 'left', offsetx,-10) " );
}
Catch (Exception)
{
Throw;
}
}
}
*/
The second method can directly add the tooltip = '<% # eval ("runscope") + "\ n \ t" %>' in the template column'