Arrao4u

…a blog by Rama Rao

Archive for the ‘Using tool tip gridview row databound event’ Category

Using tool tip in gridview row databound event

Posted by arrao4u on February 22, 2010

protected void grd_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (((Image)(e.Row.FindControl(“imgButton”))).ImageUrl == “../Images/ML.jpg”)
((Image)(e.Row.FindControl(“imgButton”))).ToolTip = “est”;
if (((Image)(e.Row.FindControl(“imgButton”))).ImageUrl == “../Images/inc.jpg”)
((Image)(e.Row.FindControl(“imgButton”))).ToolTip = “agcd”;

}

second method:

foreach (GridViewRow objDataGridItem in grd.Rows)
{
string[] objarray;
string strToolTip = string.Empty;

if (objDataGridItem.Cells[2].Text.Contains(“:”))
{
strToolTip = objDataGridItem.Cells[2].Text;
objarray = strToolTip.Split(‘:’);
strToolTip = objarray[0].ToString();
objDataGridItem.Cells[2].ToolTip = “rama test by ” + strToolTip;
}

}
////

Posted in Using tool tip gridview row databound event | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.