protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        GridViewBind();
    }
    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {
        //e.Row.Cells[0].Visible = false;
      
    }
上面两段代码是不是不能一起用的啊?
      隐藏了第一列后分页就不行了
   隐藏的去掉后分页可以我试过的,,,,,
  
  这个问题能解决么????或者还有其他方法么????
  谢谢啊

解决方案 »

  1.   

    应该有这种可能性,如果你使用GirdView自带分页的话,你可以看到,他的Footer其实只有一列,如果你隐藏了,自然看不到,你换成这样试试:
       protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
        {
           if (e.Row.RowType == DataControlRowType.DataRow)
                e.Row.Cells[0].Visible = false;
          
        }
    这个应该没有问题了
      

  2.   

    换成下面的if (e.Row.RowType != DataControlRowType.Pager)