4 Replies Latest reply on Aug 16, 2007 5:16 AM by johnsonj26

    Datagrid scroll error.

      I have an application that utilizes a datagrid to display information. When the app. is compiled and running the data grid will drop an error if you scroll to the bottom and back up quickly. I am using Flex Builder 2 version 2.0.167022 and have applied all of the hotfixes and updates. I have search the net for answers and all I have found is that you have apply the hotfixes and updates. So I was wondering if anyone knows of a fix or a way to catch the error.
      This is the error I receive:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.controls::DataGrid/ http://www.adobe.com/2006/flex/mx/internal::getMeasuringRenderer()
      at mx.controls::DataGrid/::adjustVerticalScrollPositionDownward()
      at mx.controls::DataGrid/mx.controls:DataGrid::configureScrollBars()
      at mx.controls.listClasses::ListBase/set verticalScrollPosition()
      at mx.controls::DataGrid/mx.controls:DataGrid::scrollHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/dispatchEvent()
      at mx.controls.scrollClasses::ScrollBar/ http://www.adobe.com/2006/flex/mx/internal::dispatchScrollEvent()
      at mx.controls.scrollClasses::ScrollThumb/::mouseMoveHandler()
        • 1. Re: Datagrid scroll error.
          batmitra Level 1
          how are you handling the events of datagrid? I ask this because if you are using tke click event to slect an item on the grid then you are wrong. Why? because the click event gets fired whenever you click anywhere on the grid, so my gues is when you are scrolling fast up, somewhere in your data there's a null element that flex doesn't know how to deal with. So if this is the case, use the change event , your scroll problems will go away.

          I had the same problem and that how i solved it.
          • 2. Re: Datagrid scroll error.
            johnsonj26 Level 1
            Thanks for the advice but I'm not using any events with the datagrid. It is only displaying information and nothing else.

            Thanks again.
            • 3. Re: Datagrid scroll error.
              ntsiii Level 3
              Are you using any custom itemRenderers?
              • 4. Re: Datagrid scroll error.
                johnsonj26 Level 1
                I am not using any itemrenderers. This is mxml for the DG.

                <mx:DataGrid id="mainDataGrid" x="22" y="447" width="687" height="279" resizableColumns="false" showHeaders="false" cornerRadius="0" borderStyle="none" alternatingItemColors="#ffffff" horizontalGridLines="false" horizontalGridLineColor="#000000" verticalGridLines="false" verticalGridLineColor="#000000" rowHeight="25" editable="false" enabled="true" dropShadowEnabled="false" dataProvider="{prodProducts}" fontFamily="Verdana" variableRowHeight="true" themeColor="#ffffff">
                <mx:DataGridColumn dataField="ProductSAP" width="120" wordWrap="true"/>
                <mx:DataGridColumn dataField="ProductMAPICS" width="125" wordWrap="true"/>
                <mx:DataGridColumn dataField="ProductDesc" width="330" wordWrap="true"/>
                <mx:DataGridColumn dataField="ProductCost" wordWrap="true"/>