代码贴出来了, 调试时都能通过,不管if判断成功不成功,页面就是没反应,grid的编辑状态不出来,也没有页面的提示。不加if判断,编辑状态可以出来。哪位高人能给看看,谢谢了豆不多,不好意了。
protected void grdMember_(object sender, GridViewEditEventArgs e)
{
if (grdMember.Rows[e.NewEditIndex].Cells[7].Text.ToString() == "0")
{
grdMember.EditIndex = e.NewEditIndex;
Bind();
}
else
{
grdMember.EditIndex = -1;
Bind();
Response.Write(this, "该笔付款已完成,不能重复付款!");
}
}
换成这样试试:
protected void grdMember_(object sender, GridViewEditEventArgs e)
{
int index=e.NewEditIndex;
if (grdMember.Rows[index].Cells[7].Text.ToString() == "0")
{
grdMember.EditIndex = index;
Bind();
}
else
{
grdMember.EditIndex = -1;
Bind();
Response.Write(this, "该笔付款已完成,不能重复付款!");
}
}