跟代码,检查 e.CommandArgument 的值及前台绑定.

解决方案 »

  1.   

    改成这样试试
    其中 JobID 应为 GridView 主键列
    ----------------------------------------------
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            GridView1.SelectedIndex = Convert.ToInt32(e.CommandArgument);
            if (e.CommandName == "modify")
            {
                int JobID = Convert.ToInt32(GridView1.SelectedValue)];
            }
        }