您的位置:首页 > 其它

GridView下进行编辑操作,根据某项指标判断该行是否可以进行编辑.

2009-07-06 17:15 597 查看
在GridView下进行编辑操作,根据某项指标判断该行是否可以进行编辑.

]protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
string strID = this.GridView1.DataKeys[e.NewEditIndex].Value.ToString();
string strsql = "SELECT IsUsed FROM tableaccount where ID='" + strID + "'";
string Str = amsDb.GetSingleValue(strsql);
if (Str == "0")
{
amsDb.AlertForPage(Page, "请注意,如果操作确定后,数据将不能进行修改!");
GridView1.EditIndex = e.NewEditIndex;
this.GridView1.EditRowStyle.BackColor = System.Drawing.Color.AliceBlue;
bindASPXGV();
}
else
{
bindASPXGV();
amsDb.AlertForPage(Page, "已经处理过了,不能再进行编辑!");
}
}


以备忘!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐