2 Replies Latest reply on Apr 12, 2007 9:47 PM by holyman2k

    Potential Bug in the DataGrid Control Class

      There is a problem with the DataGrid control that I traced to the ListBase class.

      When the data in the dataProvider dispatches a collection change event it causes an updateDisplayList to Occur.

      in the block of code in ListBase.as from Line 2831 to 2848, it first checks to see if the dataProvider has Items, which is true, then it checks to see if we have a pending scroll position, which is 0 because the collection change event causes the ListBase to set the pending positions to 0. since horizontalScrollPositionPending and verticalScrollPositionPending are equal to 0. it sets the scroll bars position to 0 leaving the view unchanged. This causes the scrollbars and the datagrid view to loose sync.

      I've created my own paging dataset that extends ListCollectionView. This dataset holds a buffer of 5 pages of data and queries more data via a Web Service. everytime I set the list variable it dispatches a collection changed event.

      also I've noticed there is alot of clean up logic inside of the dataProvider setter in ListBase.as which does not get called because I'm not setting a new dataProvider... just changing the data in the list.

      There may be other methods that I could try that will not dispatch a collection changed event which would keep the pending positions to NaN. I haven't explored those options yet, this appeared to me to be a bug.