gridView取值方法查询后是gridView.GetRowCellValue()方法,为什么我的项目中没有GetRowCellValue方法啊,应该怎样实现单元格取值?

解决方案 »

  1.   

    gv.Rows[i].Cells[j]
      

  2.   

    如果是取文本:
    string value = GridView1.Rows[rowIdx].Cells[colIdx].Text;如果是取控件:
    Label label = (Label)GridView1.Rows[rowIdx].Cells[colIdx].FindControl("Label1");
      

  3.   

    楼主说的GetRowCellValue()方法是DevExpress的控件GridControl才有,那不是Winfom自带的,是第三方组件
      

  4.   


    TextBox txtValue;
    int rowsCount = this.Gv.Rows.Count;
     // 遍历
                    for (int i = 0; i < rowsCount; i++)
                    {
                        // 获行当前行
                        gridRow = this.Gv.Rows[i];
                        // 通过DATAKEYS来取行没显示出来的ID号
                        pd.ID = Convert.ToInt32(this.Gv.DataKeys[i].Value);
                        //批量更新
                        txtValue = (TextBox)gridRow.FindControl("txtComment1");
            
         // 获取到txtComment1    
                    }
      

  5.   

    gv.Rows[i].Cells[j]   1楼说得对