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

Bug when DataLoadMode is set to Asynchronous

1 Answer 51 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Ivan Zlatanov
Top achievements
Rank 1
Ivan Zlatanov asked on 05 Jan 2012, 05:45 PM
Hi,

When you set DataLoadMode to Async, and try to expand any item the scroller always gets reset and scrolls to top. This is really annoying, can you confirm this is a bug please, and not something "by design"?

Also can you propose a solution, please?

Kind Regards,

Ivan Zlatanov.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 06 Jan 2012, 08:35 AM
Hi Ivan,

Actually this behaviour is by design due to the specific Asynchronous loading mode.

You could change it and avoid the scrolling back to the first item like so:

private double offset;
  
        private void radTreeListView1_DataLoaded(object sender, System.EventArgs e)
        {
            this.Dispatcher.BeginInvoke((Action)(() =>
            {
                this.radTreeListView1.ChildrenOfType<GridViewScrollViewer>().First().ScrollToVerticalOffset(offset);
            }));
        }
  
        private void radTreeListView1_RowIsExpandedChanging(object sender, Telerik.Windows.Controls.GridView.RowCancelEventArgs e)
        {
            offset = this.radTreeListView1.ChildrenOfType<GridViewScrollViewer>().First().VerticalOffset;
        }

Please let me know if you have any problems with this code.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TreeListView
Asked by
Ivan Zlatanov
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or