首先先定义一个全局变量,里面放一些需要进行更改的列名
public static List<string> gdv_FileName = new List<string> { "CARID" };
然后在gridView中的ShowingEditor设置
var _Gdv = sender as GridView; if (_Gdv == null) { return; } var _Advice = _Gdv.GetFocusedRow() as EntityCarOtherInfo;
当此列不再可编辑列之中调出
if (!gdv_FileName.Contains(_Gdv.FocusedColumn.FieldName))
{
e.Cancel = true;
return;
}
///当状态为1的时候后新增可编辑否则不可编辑
if (_Advice.EditStatus != 1)
{
e.Cancel = true;
return;
}