日期:2014-05-17 浏览次数:20505 次
private void NewMethod(string count, string where)
{
DM dm = new DM();
sql = @"select " + count + @" * FROM V_SSSQFX where 1=1 " + where;
DataSet ds = dm.getsql(" SELECT " + count + @"* from V_SSSQFX where 1=1 " + where + " order by 所属县");
//分页处理
pds = new PagedDataSource();
pds.DataSource = ds.Tables[0].DefaultView;
pds.AllowPaging = true;//允许分页
pds.PageSize = this.anp_page.PageSize;//取控件的分页大小
pds.CurrentPageIndex = this.anp_page.CurrentPageIndex - 1;//显示当前页
this.anp_page.RecordCount = ds.Tables[0].Rows.Count;//记录总数
rpt_sssqfx.DataSource = pds;
rpt_sssqfx.DataBind();
}
------解决方案--------------------
Repeater嵌套绑定(嵌套3层),那么只需要第一层分页,那两层都不需要分页了。
比如我们翻开第二页,只有第一层数据显示,第二、三层数据不显示,那么就是第二、三层没绑定出数据来。
也就是第一层分页,第二层,第三层让其数据全部显示出来。