Possible to cancel paging in ListView using DataPager

Posted by Littlefool on Stack Overflow See other posts from Stack Overflow or by Littlefool
Published on 2010-04-14T06:11:02Z Indexed on 2010/04/14 6:12 UTC
Read the original article Hit count: 429

Filed under:
|
|
|

I'm using a datapager control on my listview to perform paging in it.

When paging through the table, I need to perform some validations. When these validations are not successfull, the paging should be cancelled.

I currently perform the validation in the PagePropertiesChanging event of the ListView, however, the arguments do not provide a Cancel property.

protected void MyListView_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
{
     if (!Validate())
     { // cancel the paging action}
} 

Does anyone know if canceling the paging is possible and how to perform it? Thanks

© Stack Overflow or respective owner

Related posts about datapager

Related posts about cancel