http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=2685

解决方案 »

  1.   

    你可以用模板列去做。加上html的控件checkbox. checkbox的id为固定值,value绑定他所在行的数据的主键。此行的tr id也绑定主键。就可以用js去辨别控制此行的背景色。在js里遍历所有控件。因为checkbox的id是固定的,所以判断控件id是***的就判断其是否选中,选中则取其值,用逗号分割累加。删除时,就得到一个由一串ID组成的字符串,就可以批量删除了。
      

  2.   

    加入下面代码 
    Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
            
            If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
                e.Item.Attributes.Add("onmouseover", "document.getElementById('temp').value='" + e.Item.Cells(0).Text + "';currentcolor=this.style.backgroundColor;this.style.backgroundColor='#ffffcc'")
                e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor")
                e.Item.Attributes.Add("onclick", "document.getElementById('TextBox1').value=document.getElementById('temp').value;")
            End If
        End Sub
      

  3.   

    这个我解决了,谢谢,经过大家的帮助,里边我实现了锁定标题,滚动条,和单击引发selectedindexchange事件,双击实现该弹出该条记录的编辑页面。大家如有该方面的问题,我给你们发全部原代码过去!qq10674566