Click here to Skip to main content
15,920,677 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
if (e.Row.RowType == DataControlRowType.DataRow)
       {
          // e.Row.ToolTip = e.Row.FindControl("Country").ToString();
             Label lblReview = (Label)e.Row.FindControl("Country");
              string tooltip = lblReview.Text;
              e.Row.Cells[3].Attributes.Add("title", tooltip);

       }

Hey Every one i want to do this i retrieve some record from database and show in tooltip. My gridview have 5 column one Column is Id then if i am cursor move in id cloumn so tooltip show record with respect to id...
Posted

1 solution

Try 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!";
   }
}



http://forums.asp.net/t/1808318.aspx/1[^]
 
Share this answer
 
v2
Comments
Arsalaan Ahmed 6-Jul-13 4:29am    
Another solution

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