自定义分页时 DataGrid1.PageCount永远都是1;

解决方案 »

  1.   

    有10页,只要一打开自定义分页,测试this.DataGrid1.PageCount的值时只有1页.搞不懂!!!
      

  2.   

    There are two properties of DataGrid that are important in this context: 
    AllowCustomPaging 
    VirtualItemCount seeCustom Paging In DataGrid
    http://www.dotnetbips.com/displayarticle.aspx?id=138
      

  3.   

    如果想用DataGrid的分页功能,去掉AllowCustomPaging=True。
    如果自已写了分页,将代码贴上来
      

  4.   

    把自定义分页功能去掉吧!AllowCustomPaging=false
      

  5.   

    因为页总数要你自己算的,有个VirtualCount属性
      

  6.   

    AllowCustomPaging = false 就好了,前提是不使用自定义分页。
      

  7.   

    分页的功能要自己写,好比这样:
    放一个TextBox,一个button,跳到第n页,根据用户输入DataGrid1.CurrentPageIndex = n;...
    如果你希望DataGrid1.PageCount =10;
    AllowCustomPaging=false;
    AllowPaging=True;
    PageSize=5;
    PagerStyle.Visible = false;
      

  8.   

    virtualcount属性,要指定才行,要算出记录数的
      

  9.   

    Eddie005(暴走005)!!!!!!!!!!!!!!!!!!!
    我以前实现过,自定义分页用的是调整
    CurrentPageIndex的值
    重新绑定相同的数据源即可.
      

  10.   

    没打开分页功能前可显示50条记录,为什么打开分页功能和自定义分页功能后,
    AllowCustomPaging=True
    AllowPaging=True
    PageSize=5
    调试和测试时发现
    只有一页(应该有10页才对)
    this.DataGrid1.PageCount=1
    因此只有一页,不能现实分页,为什么?自定义分页为何这个还打开?AllowPaging=True
      

  11.   

    明白了,是所谓的自定义分页要,连数据源也自定义,
    我用的是自定义了几个按钮实现分页.(本以为这就是定义分页了,原来错在这儿)
    AllowPaging=True
      

  12.   

    建议在DataSet里面分页,用后端控制,前端直接绑定就行了