DreamingWell Logo

Horizontal Scrolling in DataGrids with many Columns

Posted by Travis Collins at May 1, 2008 12:51 PM

Out of the box, horizontal scrolling in datagrids with many columns is not smooth; especially if your view has many visible rows. A cheap and easy way around this is to disable "liveScrolling". Without liveScrolling, the datagrid will not redraw until mouseUp from the scroll.

To improve on that, I wanted to have vertical liveScrolling and horizontal non-liveScrolling. The solution is simply to use the following function as an event handler for the "scroll" event on the dataGrid.

private function dataGridScroll(event:ScrollEvent):void { exhaustGrid.liveScrolling = (event.direction == "vertical"); }

The downside is that the first vertical scroll after a horizontal scroll will not be a live scroll. I am sure there is an easy way around that.

 

Post a comment




Remember Me?


Twitter Status

Travis flying into LAX today for #AdobeMax through Wednesday.

Last Seen in

Reston, Virginia

 

Copyright DreamingWell.com 2010