Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
785
ScrollIntoView timing issue
posted

Hi,

 

I'm using the grid to bind to an ICollectionView. I've added a behaviour on the grid so that it binds to the CurrentItem.
When the CurrentItem changes, it will select the corresponding row and call ScrollIIntoView on it. Vice-versa selecting a row calls MoveCurrentTo() on the ICollectionView.

 

I've used that in some other part of the application and it works great. However, on this new grid I do the following operations (the grid uses TemplateColumns):

- _myCollectionView.Clear();

- var savedPosition = _myCollectionView.CurrentPosition;

- foreach(...) {  _myCollectionView.Add(myObject); }

- _myCollectionView.MoveCurrentToPosition(savedPosition);

 

Unfortunately the current item is selected (the row is coloured), but it's not brought into view.

Now if I replace the last instruction by:

- SynchronizationContext.Current.Post((o) => _myCollectionView.MoveCurrentToPosition(savedPosition));

 

Then it brings the current item to view.

 

Am I doing something wrong or is this a bug of the grid?

 

PS: If I can I'll try to create a test project.

 

Cheers.

Parents Reply Children
No Data