0 Replies Latest reply on Jun 30, 2009 4:44 AM by martinjconnolly

    Handling ctrl+double click in a datagrid

    martinjconnolly Level 1

      Hi all

      I want to have a different action if I double-click a row in a data grid, or hold down ctrl while double-clicking. If I double-click then the selectedItem property of the datagrid is populated even if I don't single-click the row first. But if hold ctrl, that selecteditem is null unless I single-click first to select the row. Does anyone know why this is so or if there is a way round it? It's ugly to have to select, hit Ctrl then double click.

      Thanks

      Martin

       

      Code:

      public function registerInterest():void {

              adg1.addEventListener(MouseEvent.DOUBLE_CLICK, handleGridClick);

      }
      public function handleGridClick(event:MouseEvent):void {
          if (event.ctrlKey) { doSomething() } else { doSomethingDifferent();

      }