This is a migrated thread and some comments may be shown as answers.

ScrollIntoViewAsync Exception

2 Answers 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Koren
Top achievements
Rank 1
Koren asked on 03 Apr 2013, 03:08 PM
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):
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)
                        { }
                    }
                }
            }
        }

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 04 Apr 2013, 01:28 PM
Hello,

I have tested your code with version 2012.3.1129.40. Unfortunately I were not able to reproduce the issue. Are there any specific steps I need to perform in order to get the Exception thrown?

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Dimitrina
Telerik team
answered on 04 Apr 2013, 01:31 PM
Hello,

Additionally you can try to set the GroupRenderMode="Flat" for the RadGridView and check if you can reproduce the issue again.
 

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Koren
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or