New to Telerik UI for WPFStart a free 30-day trial

Interact with the User before the Page Changes

Updated on Sep 24, 2025

While developing an UI, which contains paging, you might want to ensure that there are no unfinished actions by the user, such as unsubmitted data, data in edit mode and others, on the current page. In this case, it's common to prompt the users if they surely want to continue. If the user refuses to continue, you should prevent the paging from happening. The place, where the prompt should be implemented, is the event handler for the PageIndexChanging event.

Here is an example of a RadDataPager that shows a MessageBox before changing the page when a condition is met.

XAML

	<telerik:RadDataPager x:Name="radDataPager"
	                        Grid.Row="1"
	                        PageSize="5"
	                        DisplayMode="All"
	                        IsTotalItemCountFixed="True"
	                        Margin="0,10,0,0" PageIndexChanging="radDataPager_PageIndexChanging" />
C#

	private bool myCondition;
	private void radDataPager_PageIndexChanging( object sender, PageIndexChangingEventArgs e )
	{
	    if ( myCondition )
	    {
	        MessageBoxResult result = MessageBox.Show( "There is unsaved data! Are you sure you want to continue?", "Confirm", MessageBoxButton.OKCancel );
	        if ( result == MessageBoxResult.Cancel )
	        {
	            e.Cancel = true;
	        }
	    }
	}

WPF RadDataPager Dialog Before Navigating to Next Page

See Also

In this article
See Also
Not finding the help you need?
Contact Support