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)
{

}

}

3个回答

把你的代码发出来看一下

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;

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


yyedwx
yyedwx 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) { } }
大约 2 年之前 回复

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)
{

}

}

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!