使用DataGrid编辑时怎样才能使删除列隐藏呢?
请问使用DataGrid点击编辑时怎样才能使删除列隐藏,点击取消时重新显示删除列呢?
------解决方案--------------------protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
this.GridView1.Columns[5].Visible = false;
this.GridView1.EditIndex = e.NewEditIndex;
this.GridView1.DataBind();
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
this.GridView1.Columns[5].Visible = true;
this.GridView1.EditIndex = -1;
this.GridView1.DataBind();
}