Click here to Skip to main content
15,920,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to show tooltip text in gridview row on mouseover?
Posted

You need to use RowDataBound of GridView for this.
C#
protected void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)
{  
   DataControlRowType rtype = e.Row.RowType;   
   if (rtype == DataControlRowType.DataRow && rtype != DataControlRowType.Footer 
       && rtype != DataControlRowType.Separator && rtype != DataControlRowType.Header 
       && rtype != DataControlRowType.Pager)   
   {  
      //Highlight Row    
      //e.Row.Attributes.Add("onmouseover", "Highlight(this,'#DCEDFF');");
      //ShowToolTip
      e.Row.ToolTip = "This text needs to shown on mouseover of the row!";
   }
}
 
Share this answer
 
ASP.NET
<asp:menu id="Menu1" runat="server" backcolor="#F7F6F3" xmlns:asp="#unknown">
           DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em"
           ForeColor="#7C6F57" StaticSubMenuIndent="10px"
           style="z-index: 1; left: 78px; top: 85px; position: absolute; height: 34px; width: 78px">
           <staticselectedstyle backcolor="#5D7B9D" />
           <staticmenuitemstyle horizontalpadding="5px" verticalpadding="2px" />
           <dynamichoverstyle backcolor="#7C6F57" forecolor="White" />
           <dynamicmenustyle backcolor="#F7F6F3" />
           <dynamicselectedstyle backcolor="#5D7B9D" />
           <dynamicmenuitemstyle horizontalpadding="5px" verticalpadding="2px" />
           <statichoverstyle backcolor="#7C6F57" forecolor="White" />
           <items>
               <%--<asp:menuitem popoutimageurl="~/IMAGES/Chrysanthemum.jpg" text="HOME" value="0">
                   <asp:menuitem navigateurl="~/Default2.aspx">
                       PopOutImageUrl="~/IMAGES/Chrysanthemum.jpg" Text="ABOUT US" Value="1">
                   </asp:menuitem>
                   <asp:menuitem text="CAREERS" value="2"></asp:menuitem>
               </asp:menuitem>--%>
               <asp:menuitem text="CLIENTS" value="4"></asp:menuitem>
           </items>
       </asp:menu>
 
Share this answer
 
For custom tooltip on a particular column for each row on mouse over of gridview row, you can refer the following post.

http://www.dotnettwitter.com/2010/11/showing-tooltip-with-some-data-from.html[^]
 
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