日期:2014-05-18  浏览次数:20849 次

如何取出PagedDataSource 中数据要求不用控件Repeater、GridView、DataList
如何取出PagedDataSource 中数据要求不用控件Repeater、GridView、DataList
  PagedDataSource ps = new PagedDataSource();
  ps.AllowPaging = true;
  ps.PageSize = 2;
  ps.CurrentPageIndex = pg - 1;
  ps.DataSource = XXXXXXX ;

要求不用控件Repeater、GridView、DataList输出ps数据

------解决方案--------------------
好啊学习
------解决方案--------------------
UP
------解决方案--------------------
应该是会的人还没有来到呢
------解决方案--------------------
PagedDataSource一般用在分页控件中,比如GridView、FromView中。如果控件开发人员需对自定义数据绑定控件提供分页支持,即可使用此类。
PropertyDescriptor pds=TypeDescriptor.GetProperties(ps);
Lable lableAllowPaging=new Label();
Controls.Add(labelAllowPaging);
labelAllowPaging.Text=allowPaging=pds["AllowPaging"].ToString();
其他属性用类似的方法都可取出来。


------解决方案--------------------
引用楼主 chinacn101 的帖子:
如何取出PagedDataSource 中数据要求不用控件Repeater、GridView、DataList 
PagedDataSource ps = new PagedDataSource(); 
ps.AllowPaging = true; 
ps.PageSize = 2; 
ps.CurrentPageIndex = pg - 1; 
ps.DataSource = XXXXXXX ; 

要求不用控件Repeater、GridView、DataList输出ps数据

------解决方案--------------------
PropertyDescriptor pds=TypeDescriptor.GetProperties(ps); 应该改为PropertyDescriptorCollection
------解决方案--------------------
自定义分页控件。。。

------解决方案--------------------
帮顶
------解决方案--------------------
up
------解决方案--------------------


------解决方案--------------------
up
------解决方案--------------------
我也顶啊
------解决方案--------------------
up
------解决方案--------------------
没用过
------解决方案--------------------
//使用PagedDataSource来实现分页
PagedDataSource pds = new PagedDataSource();
pds.DataSource = Ds.Tables[0].DefaultView;
pds.AllowPaging = true;
pds.PageSize = 17;
Label1.Text = pds.Count.ToString();
pds.CurrentPageIndex = Convert.ToInt32(this.labPage.Text) - 1;
Repeater1.DataSource = pds;
LabCountPage.Text = pds.PageCount.ToString();
labPage.Text = (pds.CurrentPageIndex + 1).ToString();
------解决方案--------------------

那就从数据源 ps.DataSource 直接取数据。

既然数据源都有了, 拿ps何用?
------解决方案--------------------
探讨
引用楼主 chinacn101 的帖子:
如何取出PagedDataSource 中数据要求不用控件Repeater、GridView、DataList
PagedDataSource ps = new PagedDataSource();
ps.AllowPaging = true;
ps.PageSize = 2;
ps.CurrentPageIndex = pg - 1;
ps.DataSource = XXXXXXX ;