7Feb/0826
Flex – Preventing DataGrid scrolling when the dataprovider is updated.
I was having issues with my DataGrid scrolling to the top when my grid updated from the server. It is very aggravating as a user when you are milling about and *BAM* it scrolls away.
This worked:
1 2 3 4 5 6 | var storeItemForUpdate:ItemVO = grid.selectedItem;; var vScroll:int = grid.verticalScrollPosition; arrayCollection.source = updatedDataArray grid.validateNow(); grid.verticalScrollPosition = vScroll; grid.selectedItem = storeItemForUpdate; |
The current selection is stored, the scroll position is stored, the grid is updated, validated, and then the stored variables are applied without so much as a flicker on the screen for the user. Much better.

The Flex – Preventing DataGrid scrolling when the dataprovider is updated. by Joel Hooks, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 3.0 United States License.
-
Joel
-
Hari
-
Joel
-
Chris
-
http://www.sousgarden.com tsedeke
-
dj brikz
-
Matt
-
joelhooks
-
Matt
-
http://joelhooks.com Joel Hooks
-
http://www.pesse.de/ Pesse
-
http://www.pesse.de/ Pesse
-
http://unlikelyteacher.com/ Paul
-
http://unlikelyteacher.com/ Paul
-
http://twitter.com/omer72 Omer Etrog
-
http://twitter.com/omer72 Omer Etrog
-
Aroldo
-
JUANABREU
-
Ricardo Aguilar
-
Pradeep
-
Pradeep
-
the_new_mr
-
Sagar Jadhav
-
Vikram Bhatla83
-
Dasun
-
Keithlee2010


















