【发布时间】:2016-01-28 07:07:30
【问题描述】:
我想在我的Silverlight 应用程序中实现服务器端分页。为了了解我需要的步骤,我经历了这个custom paging in asp.net
他们在文章中描述了如何设计SQL 查询以根据Page Requested 和Total no of records per page 返回结果。然而,我对如何从我的 Silverlight 应用程序中调用它感到非常困惑。就像我将如何在c# 代码中指定它一样。
使用DataPager 的默认分页非常简单。
PagedCollectionView pagingCollection = new PagedCollectionView(e.Result); //e.Result contains `List` returned by the method that calls the stored procedure GetProducts
pagerProductGrids.Source = pagingCollection;
gridProductGrid.ItemsSource = pagingCollection;
但我对自己做这件事的程序一无所知。比如我需要get和setPage Size、total no of records等属性,即我将如何配置我的DataGrid和DataPager以传递StartingRowIndex和Maximum RowcOunt
请帮忙!
【问题讨论】:
标签: c# silverlight datagrid server-side custom-paging