1 Reply Latest reply on Aug 15, 2007 2:46 PM by widgeter

    Datagrid  - Error "focusInHandler"

    widgeter Level 1

      I'm having a hard time figuring out why I'm getting an error with my Datagrid? The problem comes after the data is loaded into the datagrid and the user initially clicks on any col header before selecting a row. If the user selects a row or even moves the scrollbar, the col sort will be fine. Is there a way to enable focus on the datagrid so a col click won't cause this error?

      Thanks in advance, Matt

      Code snip:

      <mx:DataGrid dataProvider="{dataProvider}"
      change="dgChangeHandler()" width="100%" height="100%" id="datagrid1" horizontalCenter="120" verticalCenter="-70" >
      <mx:DataGridColumn id="firstCol" headerText="First" dataField="f_name" width="50"/>
      <mx:DataGridColumn id="lastCol" headerText="Last" dataField="l_name" width="50"/>
      <mx:DataGridColumn id="emailCol" headerText="Email" dataField="contact_email" width="140"/>

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.controls::DataGrid/mx.controls:DataGrid::focusInHandler()
      at [focusEvent]