以下是单元格变色,我想让全行都变色,那下面的this该改为什么呢(tc是单元格TabelCell,tr是行TabelRow)
tc.Attributes .Add ("onmouseover","curentcolor=this.style.backgroundColor;this.style.backgroundColor='#6699ff'");
tc.Attributes .Add ("onmouseout","this.style.backgroundColor=curentcolor");

解决方案 »

  1.   

    private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
    e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=''");
    e.Item.Attributes.Add("onmouseover","this.style.backgroundColor='#BFDFFF'");
    }
      

  2.   

    以上的我知道,可是我要只移动到某个单元格内才全行变色,而且我是动态表格,不是datagrid
      

  3.   

    liuxiaoyi666(MSMVP小猪妹马甲之八卦兔子)   完全正确,结贴了
      

  4.   

    this.style.backgroundColor改成tr.cells.backgroundColor 试一下