简体   繁体   English

Silverlight DataPager自定义分页

[英]Silverlight DataPager custom paging

I've looked at several examples and done google searches, and all I see the datapager doing is paging a certain number of items via the PageSize="X" property. 我看了几个示例,并完成了google搜索,而我看到的datapager所做的只是通过PageSize =“ X”属性对某些项目进行分页。

I would like it to page by category, is this possible? 我想按类别翻页,这可能吗?

An Example Data structure I would like to do this with would look like this. 我想使用的示例数据结构如下所示。

ID
CategoryID
Title
Value

Now instead of just paging by some arbitrary number of elements, I would like it to page by CategoryID. 现在,我不仅希望按任意数量的元素进行分页,还希望按CategoryID进行分页。

So the first page would be all records with CategoryID=1, and when I hit the next button on the pager, it would show all items with CategoryID=2 or whatever is next. 因此,第一页将是CategoryID = 1的所有记录,并且当我在寻呼机上单击下一步按钮时,它将显示CategoryID = 2或下一个的所有项目。

Is this possible? 这可能吗? How do I go about doing this? 我该怎么做呢?

Any resources or pointers would be fantastic, 任何资源或指标都很棒,

The DataPager works with the interface IPagedCollectionView. DataPager与IPagedCollectionView接口一起使用。 You could create your own implementation and give it this behavior. 您可以创建自己的实现,并赋予它这种行为。 I'm not sure how well it would work, but that is where I would start. 我不确定它的效果如何,但这就是我要开始的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM