如何在gridview行上方的鼠标上获取弹出图像? [英] How to get popup image on mouse over gridview row?

查看:58
本文介绍了如何在gridview行上方的鼠标上获取弹出图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Friends ..

如何在gridview行上的鼠标上获取弹出图像,每一行包含不同的缩略图..所以我需要弹出每一行的缩略图图像.


热烈的问候

Shivanand Nagarabetta.

Hi Friends..

How to get the popup image on mouse over gridview row, Each row contains different thumbnail image.. so i need to popup the each row thumb nail image.


Warm Regard

Shivanand Nagarabetta.

推荐答案

您可以通过以下方式执行以下操作:
1.将Javascript函数插入鼠标悬停&将鼠标移出网格行中的链接.
2.使用JavaScript,当您将鼠标悬停在该行上时,显示一个包含所需详细信息的div(此处为图片)
3.使用JavaScript隐藏div onmouseout.


要注入JS,您需要使用GridView的RowDataBound,如下所示:
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)  
   { 
      // Show div   
      // Add parameters of image as per need. may be image location passed
      e.Row.Attributes.Add("onmouseover", "ShowDiv(this);");
      //Hide div
      e.Row.Attributes.Add("onmouseover", "HideDiv(this);");
   }
}


显示网格单元的div onmouseover事件,并
隐藏网格单元的div onmoustout事件.

试试吧!


Show the div onmouseover event of the grid cell, and
Hide the div onmoustout event of the grid cell.

Try!


这篇关于如何在gridview行上方的鼠标上获取弹出图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆