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

scrollindexintoviewasync puts record on bottom of screen

1 Answer 98 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Aryn
Top achievements
Rank 1
Aryn asked on 15 Nov 2014, 12:58 AM
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


1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 19 Nov 2014, 02:40 PM
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.

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