c# - Validate data in Radgrid before changing pages -


i want validate users changes on page before allowing them go page. if validation fails want stop pager changing page.

for example:

protected void rgorderitem_pageindexchanged(object source, gridpagechangedeventargs e) {     if (mapvalues(false))     {         rgorderitem.currentpageindex = lastpageindex;         rgorderitem.databind();     } } 

this not work. pager changes regardless. know how stop page change event? thanks, tony

please try below code snippet.

protected void radgrid1_pagesizechanged(object sender, gridpagesizechangedeventargs e) {     if (mapvalues(false))     {         e.canceled = true; //prevent execute pagging functionality     } } protected void radgrid1_pageindexchanged(object sender, gridpagechangedeventargs e) {     if (mapvalues(false))     {         e.canceled = true; //prevent execute pagging functionality     } } 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -