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

GridView编辑更新取不到新值,该怎么处理

2014-01-12 
GridView编辑更新取不到新值 protected void gvWellsManager_RowUpdating(object sender, GridViewUpdateE

GridView编辑更新取不到新值

 protected void gvWellsManager_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            string wNo = ((TextBox)gvWellsManager.Rows[e.RowIndex].Cells[1].Controls[0]).Text.Trim();
            string wName = ((TextBox)(gvWellsManager.Rows[e.RowIndex].Cells[2].Controls[0])).Text.Trim();
            string sBoiler = ((TextBox)(gvWellsManager.Rows[e.RowIndex].Cells[3].Controls[0])).Text.Trim();
            string sManagerArea = ((TextBox)(gvWellsManager.Rows[e.RowIndex].Cells[4].Controls[0])).Text.Trim();
            string sIsSteam = ((TextBox)(gvWellsManager.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString().Trim();

            Wells well = new Wells();
            if (well.WellUpdate(wNo, wName, sBoiler, sManagerArea, sIsSteam))
            {
                WellsInfoBind();
            }
        }


这个代码为什么只能取到GridView原有的值,而新修改的值取不到呢?
[解决办法]
GridView新赋值的语句在哪里
[解决办法]
  //GridView改为只读状态
        this.GridView1.EditIndex = -1;

热点排行