编程转到另一个页面与一个ListView? [英] Programmatically go to another page with a ListView?

查看:134
本文介绍了编程转到另一个页面与一个ListView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法找出一个ListView产品上,并以编程方式进入该页面哪一页?我有一个控制寻呼DataPager的一个ListView。这样做的原因是,如果我在第2页的ListView和我导航离开该页面,当我回去,我要回去给ListView页面我是previously上。

Is there a way to find out what page a ListView item is on and to programmatically go to that page? I have a ListView with a DataPager that controls the paging. The reason for this is that, if I am on Page 2 of the ListView and I navigate away from the page, when I go back, I want to go back to the ListView page I was previously on.

推荐答案

您可以用得到一个项目的索引的<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listviewdataitem.displayindex.aspx\"相对=nofollow>的DisplayIndex 属性。

You can get an item's index using the DisplayIndex property.

您可以计算出它除以通过的DisplayIndex的DataPager的的的每页属性。

You can figure out what page it's on by dividing DisplayIndex by the DataPager's PageSize property.

您可以通过调用DataPager的的<一个设定的当前页面href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datapager.setpageproperties.aspx\"相对=nofollow> SetPageProperties 方法。

You can set the current page by calling the DataPager's SetPageProperties method.

这篇关于编程转到另一个页面与一个ListView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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