ScrollIntoViewAsync Exception

3 posts, 0 answers
  1. Koren
    Koren avatar
    70 posts
    Member since:
    Oct 2010

    Posted 03 Apr 2013 Link to this post

    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. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 04 Apr 2013 Link to this post

    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.

  3. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 04 Apr 2013 Link to this post

    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.

Back to Top