0 Replies Latest reply on Jun 4, 2008 2:39 AM by LittleMuscle

    Scrolling DataGrid with Arrow Keys

    LittleMuscle
      I have a datagrid that has a horizontal scroll bar and have added a keyboard event listener:
      application.addEventListener(KeyboardEvent.KEY_UP, keyHandler);

      and here is my keyHandler function:
      private function keyHandler(event:KeyboardEvent):void {
      if (event.keyCode == 37) {
      dg.horizontalScrollPosition = 0;
      }
      if (event.keyCode == 39) {
      dg.horizontalScrollPosition = 100;
      }
      }

      My issue is, that when i hit the left/right keys on the application, i get a few bugs.
      1) the scroll bar won't move unless i move it with mouse 1st
      2) data in datagrid disapear as i hit left/right keys