DreamingWell Logo

Horizontal Scrolling in DataGrids with many Columns

Posted by Travis Collins on May 1, 2008

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?


(you may use HTML tags for style)

Twitter Status

Travis @wjrothman Please read the comment I just left on your Gizmodo article about "Why a Verizon iPhone May Drop Fewer Calls...". -TravisCollins

Last Seen in

Reston, Virginia

 
Privacy Policy

Copyright DreamingWell.com 1998 - 2011