如题

解决方案 »

  1.   

    现在的问题是,怎么获取到每行的DataKey
      

  2.   

    我目前用RowCreated事件可以为每一行添加JS代码
    但是如何获取当前行的ID值,别且动态的添加一个DIV呢?
      

  3.   

     protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "MyCommand")
            {
                Button button = (Button)e.CommandSource;
                GridViewRow row = (GridViewRow)button.Parent.Parent;
                string a = row.Cells[1].Text.ToString();//获得第一个单元格的值   
                string b = this.GridView1.DataKeys[row.DataItemIndex].Values[0];//获得DataKeys的值   
            }
        }  
      

  4.   

    @mengxj85 
    如何向每一行中添加一个div呢?
      

  5.   

    用客户端解决吧,不过实现动态添加,你的系统要考虑完全,有添加就有删除、修改,甚至修改冲突。
    www.datasonar.com