scrollindexintoviewasync puts record on bottom of screen

2 posts, 0 answers
  1. Aryn
    Aryn avatar
    9 posts
    Member since:
    Jul 2014

    Posted 14 Nov 2014 Link to this post

    Hello,

    I am using scrollindexintoviewasync  to keep my record in the screen after an edit. I have the below code. It reloads the grid and then calls the ScrollIndexIntoView to display the record. But it is displaying at the bottom of the grid. Could someone please give me an idea why please?

    private void EditItem(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
            {
                GridViewRow row = e.Row;
                int index = this.RadGridView.Items.IndexOf(this.RadGridView.SelectedItem);
                GridData recordChanged = (GridData)e.NewData;
                dataService.EditRecord(recordChanged);
                this.RadGridView.ItemsSource = dataService.GetGridData();
                this.RadGridView.ScrollIndexIntoViewAsync(index, null, new Action<FrameworkElement>((f) => { (f as GridViewRow).IsSelected = true; }), null);

                LoadTablesAndGrid();
            }

    Thank you,
    Aryn


  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 19 Nov 2014 Link to this post

    Hi Aryn,

    Unfortunately RadGridView cannot guarantee the exact position for the item that has been scrolled into view. It assures the item will be brought into view, however, it cannot be additionally configured to a specific position. 

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top