问题描述
我正在vb.net开发网站。我使用Listview来显示产品。有几个过滤器可以优化搜索。我在一页上展示了36种产品。共有450个产品在数据库中。问题是如果我切换到第1页到第10页&然后从checkboxList&中应用任何过滤器在应用过滤器之后,它找到了10个产品,然后显示空白结果,但是10个产品在那里,但它仍然在第10页,所以没有显示10个产品,因为它在第1页。可以任何人帮助我如何应用过滤器后休息pageIndex? OnPagePropertiesChanged我尝试在listview获取绑定后重置页面索引,但它无法正常工作。
我尝试过:
受保护的 Sub OnPagePropertiesChanging (发件人作为 对象,e 作为 PagePropertiesChangingEventArgs )
TryCast (products.FindControl( DataPager1),DataPager).SetPageProperties(e.StartRowIndex,e.MaximumRows, False )
我 .buildWhereClause()
products.SelectedIndex = -1
结束 Sub
I am developing website in vb.net. I have used Listview to display products. There are couple of filters to refine search. I am showing 36 products in one page & have total 450 products in database. Problem is if I switched to page 1 to page 10 & then apply any filter from checkboxList & after applying filter it found 10 products then it shows blanks result but 10 product is there but it still on 10th page so not showing 10 products because it is on 1st page. Can any one help me how can I Rest pageIndex after applying filter? OnPagePropertiesChanged I tried to reset page Index after listview gets bind but it is not working.
What I have tried:
Protected Sub OnPagePropertiesChanging(sender As Object, e As PagePropertiesChangingEventArgs) TryCast(products.FindControl("DataPager1"), DataPager).SetPageProperties(e.StartRowIndex, e.MaximumRows, False) Me.buildWhereClause() products.SelectedIndex = -1 End Sub
这篇关于应用过滤器后重置listview的listview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!