设置DataPager的的的PageIndex [英] Set PageIndex of DataPager

查看:590
本文介绍了设置DataPager的的的PageIndex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我一个传呼DataPager的一个ListView。我想设置上的Page_Load寻呼机的初始页面。我曾尝试DataPager.SetPageProperties方法,但它没有做什么,我需要。下面是我如何调用此方法:

I have a ListView that I am paging with a DataPager. I would like to set the initial page of the pager on Page_Load. I have tried the DataPager.SetPageProperties method but it's not doing what I need. Here's how I'm calling this method:

dataPager.SetPageProperties(3, dataPager.TotalRowCount, false);



该线之上修剪数据源的第三个项目启动和呼叫仍从1开始。这是不是我想要的。我想保留项目的完整列表,只是跳转到列表中的某个特定页面。

The line above trims the datasource to start at the third item and paging still starts at 1. This is not what I want. I want to keep the entire list of items and just jump to a specific page in the list.

是否有其他房产和/或DataPager的和/或ListView的方法我应该使用?

Is there another Property and/or method of a DataPager and/or ListView that I should use?

任何帮助将不胜感激。

谢谢!

推荐答案

试试这个。未经测试。

Try this. Not tested.

- 编辑 -

dataPager.SetPageProperties( 
    (3 * dataPager.PageSize, 
    dataPager.MaximumRows, 
    false
);

这篇关于设置DataPager的的的PageIndex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆