where are you changing the color? client side or server side? did you want to find out the background color? server side or client side?it is a bad idea to use background color to 决定是否删除, you should use an array or set some attribute on TR

解决方案 »

  1.   

    client side ,
    怎样才能用一个数组去操作要删除的行呢?首先是怎么才能选定所有要删除的行?
      

  2.   

    add a column to contain a checkbox, when the user 单击后改变颜色, you also check the checkbox, then on the server side, you check if the checkbox is checked, you could try RowSelector control recommended by DataGrid girlhttp://www.datagridgirl.com/rowselector.aspx
      

  3.   

    use javascript:<table border="1" id="tbl">
     <tr><td>hello world</td></tr>
     <tr><td>hello world</td></tr>
     <tr><td>hello world</td></tr>
     <tr><td>hello world</td></tr>
    </table><script language="javascript">
    function getRow(e)
    {
      while (e != null && e.tagName != "TR")
    e = e.parentElement;  return e;
    }function tbl.onclick()
    {
      var e = event.srcElement;
      e = getRow(e);
      if (e != null)
      {
    if (e.style.backgroundColor == "")
    e.style.backgroundColor = "green";
    else
    e.style.backgroundColor = "";
      }
    }
    </script>