how to set it for OutSide the Gridview not a Inside Gridview.
For this, you need to have javascript onmousein & onmouseout for the control. In the JS method, show/hide a div placed somewhere as per your need. This div will have text that you want to show.
You can do the following by:
1. Inject Javascript function on mousehover & mouseout of the link in a grid row.
2. Using JavaScript, show a div that contains the needed details(image here) when you hover your mouseover that row
3. Using JavaScript, hide the div onmouseout.
For injecting JS, you need to use
RowDataBound
of GridView, something like:
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)
{
TextBox tb = (TextBox)e.Row.FindControl("myTextBox");
tb.Attributes.Add("onmouseover", "ShowDiv(this);");
tb.Attributes.Add("onmouseover", "HideDiv(this);");
}
}
Show the div
onmouseover
event of the grid cell, and
Hide the div
onmoustout
event of the grid cell.
Put the same logic for any/all controls that you want to have it.
Try!