比如  我想取gridview第2列的第1行数据(772)和第2列的第2行数据(765)该怎么取呢?还有就是我想动态的把每列的所有单元格的值求和显示在页脚该怎么做呢???(主要是数据随时都在变化...列和行都在不断的增加和减少)
比如:
ip                15:27  15:43 15:55 16:17 16:21 16:23 16:44 16:48 16:50 16:54 17:1 17:6 
123.129.243.99     772    929   819   783   799   831   747   847   925   895  1063 1287 
192.168.1.88:89    765    761   786   519   594   630   592   676   747   864  982  1283 求和               1234   1777     高分求助......

解决方案 »

  1.   

    int.Parse(this.GridView.Rows[0].Columns[1].Text) + int.Parse(this.GridView.Rows[1].Columns[1].Text)数据变化有什么关系,但是和肯定是当前显示的和
    那就绑定的时候求和就好了
    数据变
    和也跟着变
      

  2.   

    所有单元格的值求
    ================
    在GridView的RowDataBund的事件中把每个单元加起来!!
      

  3.   

    偶没做过,说下思路,不知道能不能实行.
    写在RowDataBound事件中,或者是load里.(你看看这事件对不对)
    for (int i = 0; i < GridView.Rows.Count - 1; i++) 通过循环,得到每行,Rows[i].Cells[i].Text得到你的值...
      

  4.   

    1.gridview1.Rows[01].cells[2].value
    2.gridview1.selectrows.cells[2]..
    求和的在数据库内计算好,在前台显示。。
      

  5.   

    设关键字 KEYNAME 取出来最好的办法,用JS写,选取当前行拿KEYNAME种放的值。
      

  6.   

    //遍历GridView查找某类控件(只能在输出的行列中查找)
    protected void reportpathset()
        {
           
            for (int i = 0; i < this.GridView1.Rows.Count; i++)
            {
                for(int j=0;j<this.GridView1.Rows[i].Cells.Count;j++)
                {
                foreach (Control ctl in this.GridView1.Rows[i].Cells[j].Controls)
                {
                   if (ctl.GetType().Name == "HyperLink")
                    {
                        HyperLink hl = new HyperLink();
                        hl = (HyperLink)ctl;
                        if (hl.NavigateUrl == "Report/empty.doc")
                        {
                            hl.Text = "无报告";
                            hl.NavigateUrl = "#";
                            hl.CssClass = "";
                        }
                    }
                }
                }
            }
            
        }
      

  7.   

    肯定在GridView1_RowDataBound事件啊
      

  8.   


    Rows[0].Columns  ....Rows貌似没有Columns属性..
      

  9.   

    GridView1_PreRender在这个事件里面怎么做啊????
      

  10.   

    if (e.Row.RowType == DataControlRowType.DataRow)
    {
         e.Row.Cells[1].Text//1:是你的列的下标
    }