My users have been getting intermittent exceptions in the grids where we are scolling down to the new records after an add. I am attaching the error message. I added the try/catch to the sync to try to stop the unhandled exception error but it didn't seem to work because another user had an error after this code went out.
We are using version 2012.3.1129.40 (can't upgrade to 2013.1.220 for a few more weeks as this is our busy season).
Here is a sample of the code in one of the gridviews (used similar logic in the other grids):
We are using version 2012.3.1129.40 (can't upgrade to 2013.1.220 for a few more weeks as this is our busy season).
Here is a sample of the code in one of the gridviews (used similar logic in the other grids):
private void grdCash_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
{
this.grdCash.KeyboardCommandProvider = new DefaultKeyboardCommandProvider(this.grdCash);
if (e.EditAction == GridViewEditAction.Cancel)
{
return;
}
else
{
//Update the entry in the view model
if (DataContext is BatchCashViewModel)
{
_batchCashViewModel.UpdateBatchCashRecordCommand.Execute(e.NewData);
if (e.Row is GridViewNewRow)
{
try
{
this.grdCash.ScrollIntoViewAsync(this.grdCash.Items[this.grdCash.Items.Count - 1], //the row
this.grdCash.Columns[1], //the column
new Action<
FrameworkElement
>((f) =>
{
(f as GridViewRow).IsSelected = true; // the callback method
}));
}
catch (Exception ex)
{ }
}
}
}
}