I am using MVVM and binded data collection having data(1000) with XamGrid.
I am enableing Paging with default page size =10. XamGrid is editable and on editing of data it updates Dirty flag true for that perticular record. My Requirement is, On page move ( PageIndexChanging) event . I check any dirty record in page. That i able to do. But, I need to show message "Do you want to move without saving" with Ok/cancel. If Ok then moves next or on Cancel reamins same page.
I have custom dialog to show message which is not modelDialog. Can you suggest any solution.
Sorry ! to update Tkt. I able to resolve issue with your suggestion.
Thanks again for you feed back on issue.
Hello,
Were you able to resolve this issue?
Valerie
Hi,
You should use the PageIndexChanging event:
In the event you can check to see if your data is dirty, if it is, then you can cancel paging and store off the index it was going to, then show your message box:
int _nextIndex;
void grid_PageIndexChanging(object sender, CancellablePageChangingEventArgs e)
{
if (isDirty)
this._nextIndex = e.NextPageIndex;
e.Cancel = true;
// Show MessageBox.
}
Then in your EventHandler for the "Ok" button, you can set the CurrentPageIndex: this.grid.PagerSettings.CurrentPageIndex = 4;
Hope this helps ,
-SteveZ
While paging event (pageIndexChanged) handler i want to popup message box(Ok/Cancel). if any data change in page. ( i have flag dirty in each row data where i make true on change). I don't want to page next if it 'Cancel' press.
1. how can i change page programmatically ?
Do you still need assistance with this matter?