想在鼠标移到gridview数据行上方时,显示当前行的首列数据。(显示在鼠标上方或下方都行,不挡住当前数据就行)。请问各位大侠有没有方法啊?

解决方案 »

  1.   

     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
       if (e.Row.RowType == DataControlRowType.DataRow)
    {
     e.Row.Attributes.Add("onmouseover", GridView1.ToolTip = e.Row.Cells[0].Text);
     e.Row.Attributes.Add("onmouseout", GridView1.ToolTip = "");}}大家帮忙看看我这么写为什么只显示最后一行的首列呢?而且,tooltip好像反应比较迟钝。
      

  2.   

    e.Row.Attributes.Add("onmouseover", showData(e.Row.Cells[0].Text)); script:function showData(txt)
    {
    div1.visible=ture;
    div1.innertxt=txt;}自己发挥 !