OptionsColumn需要什么命名空间吗?

“System.Web.UI.WebControls.DataControlField”不包含“OptionsColumn”的定义,并且找不到可接受类型为“System.Web.UI.WebControls.DataControlField”的第一个参数的扩展方法“OptionsColumn”(是否缺少 using 指令或程序集引用?)

代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class caiwu_jinjirenxinzichakan : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.GridView1.Columns[3].OptionsColumn.AllowEdit = false;

}
protected void Button1_Click(object sender, EventArgs e)
{

}

}

把你的代码发出来看一下

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Configuration;
using planning.integration.platform.util;
using System.IO;
using DevExpress.XtraEditors.Controls;

this.gridView1.Columns[9].OptionsColumn.AllowEdit = false;

我这样是可以点出来的,你试试


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class cw_xinzichakan : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.GridView1.Columns[3].OptionsColumn.AllowEdit = false;

}
protected void Button1_Click(object sender, EventArgs e)
{

}

}