Ref:http://www.aspforums.net/Threads/817841/Display-Image-as-ToolTip-on-MouseOver-of-GridView-Row-in-ASPNet/
Here using the Ajax Hover Menu extender you can show the complete GridViewRow data in Popup.
HTML
<form id="form1" runat="server">
<div>
<cc1:ToolkitScriptManager runat="server">
</cc1:ToolkitScriptManager>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" ShowHeader="false">
<RowStyle Height="40px" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="Panel1" runat="server" Width="400px">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("Text") %>'></asp:Label>
</asp:Panel>
<cc1:HoverMenuExtender ID="HoverMenuExtender1" runat="server" PopupControlID="PopupMenu"
TargetControlID="Panel1" PopupPosition="Bottom">
</cc1:HoverMenuExtender>
<asp:Panel ID="PopupMenu" runat="server" CssClass="modalPopup">
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Text") %>'></asp:Label>
<br />
<hr />
<asp:Image ID="Image1" runat="server" CssClass="popupHover" ImageUrl='<%# Eval("Value") %>'
Height="100px" Width="100px" />
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
Style
<style type="text/css">
.modalPopup
{
background-color: #FFFFFF;
border-width: 3px;
border-style: solid;
border-color: black;
margin: 10px;
padding: 10px;
width: auto;
height: auto;
}
body
{
cursor: pointer;
font-family: Arial;
font-size: 10pt;
}
table
{
border: 1px solid #ccc;
}
table th
{
background-color: #F7F7F7;
color: #333;
font-weight: bold;
}
table th, table td
{
padding: 5px;
border-color: #ccc;
}
</style>
Namespaces
using System.IO;
using System.Collections.Generic;
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string[] filePaths = Directory.GetFiles(Server.MapPath("~/Images/"));
System.Collections.Generic.List<ListItem> files = new List<ListItem>();
foreach (string filePath in filePaths)
{
string fileName = Path.GetFileName(filePath);
files.Add(new ListItem(fileName, "~/Images/" + fileName));
}
GridView1.DataSource = files;
GridView1.DataBind();
}
}
Screenshot
