我要根据表中的一个字段来判断修改项目,写了下面的代码,怎么不行啊?哪位给我纠正1下,谢谢
protected void gvData_RowEditing(object sender, GridViewEditEventArgs e)
{ if (Convert.ToInt32(this.gvData.Rows[e.NewEditIndex].Cells[2].Text) == 3)
{
this.gvData.Rows[e.NewEditIndex].Cells[5].Attributes["ReadOnly"] = "True";
}
else
{
this.gvData.Rows[e.NewEditIndex].Cells[5].Attributes["ReadOnly"] = "False";
}
}
protected void gvData_RowEditing(object sender, GridViewEditEventArgs e)
{ if (Convert.ToInt32(this.gvData.Rows[e.NewEditIndex].Cells[2].Text) == 3)
{
this.gvData.Rows[e.NewEditIndex].Cells[5].Attributes["ReadOnly"] = "True";
}
else
{
this.gvData.Rows[e.NewEditIndex].Cells[5].Attributes["ReadOnly"] = "False";
}
}
解决方案 »
- 为什么mshtml有的网站可以获取IHTMLInputElement有的却不行?!
- c# oracle在服务器资源管理器中已连接,但拖动表到.dbm1时出现以下错误:所选对象使用不支持的数据提供程序
- C# 调用 dl 求助 报错 System.AccessViolationException
- 怎么让同一个页面指定不同浏览器(包括浏览器名称,版本)同时打开怎么做??
- 绑定数据源问题~
- 各位老大!有誰能告訴我,一個標準的軟件公司的開發流程嗎?詳細描述,因爲我想跳槽。
- ===求教执行大量数据操作时,出现无法显示网页的解决方法===
- 超级难问题,我费了很大劲画好的,DATAGRID的这个问题有人做过吗!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 关于软件使用次数的问题?如何进行软件加密。。。。。。
- 大家来讨论,请各位大哥们指点迷津,详情请看。。。。。。。。。。
- Web Service部署问题,哪位帅哥帮帮忙啊?
- socket如何显示中文
this.gvData.Rows[e.NewEditIndex].Cells[5].Attributes["ReadOnly"] = "True";
但是不知道该怎么写。
就可以实现不能修改的目的吧?