首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

gridviw Cell有关问题

2011-12-14 
gridviw Cell问题for (int i 0 i this.grv_kecheng.Rows.Count i++){//课程从第一门开始循环GridVie

gridviw Cell问题

  for (int i = 0; i < this.grv_kecheng.Rows.Count; i++)
  {
  //课程从第一门开始循环

  GridView rowi = this.grv_kecheng.Rows[i];//取得当前行,即首行
  string kecheng = rowi.Cells[0].Text.ToString();
  Response.Write(rowi);
  }



错误:“System.Web.UI.WebControls.GridView”并不包含“Cells”的定义
有时候可以运行成功,有时候不成功,是什么原因呢?是命名空间没有使用吗?cells使用什么命名空间呢?

[解决办法]
GridView rowi = this.grv_kecheng.Rows[i];//取得当前行,即首行

===========> GridViewRow rowi = this.grv_kecheng.Rows[i];//取得当前行,即首行

热点排行