0 Replies Latest reply on Jan 29, 2010 10:59 PM by Deepa Ganesan

    Add Custom Right click menu on editable AdvancedDataGrid

    Deepa Ganesan



      I have an AdvancedDataGrid whose editable property is set to true and selectionmode is multipleCells.

      Is it possible to display custom right click menu when i right click on any cell? Am getting only the

      default menu items (Cut, Copy, Paste, Select All). Am using ContextMenu and ContextMenuItem class

      for creating the custom right click menu. The same code is working in Flex and not in AIR. Do we have

      to use NativeMenu in Adobe AIR? Please help. Attaching sample of my code.









      private var cMenu:ContextMenu;



      public function createContextMenu():void {


           cMenu =

      new ContextMenu();


           cMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelect);



           var cMenuItemCopy:ContextMenuItem = new ContextMenuItem("Copy Data");

           cMenuItemCopy.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItemSelect_Copy);


           var cMenuItemPaste:ContextMenuItem = new ContextMenuItem("Paste Data");

           cMenuItemPaste.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItemSelect_Paste);





      this.contextMenu = cMenu;    








      function contextMenu_menuSelect(event:ContextMenuEvent):void {





      private function contextMenuItemSelect_Copy(event:ContextMenuEvent):void {





      private function contextMenuItemSelect_Paste(event:ContextMenuEvent):void {







      width="100%" height="72%" id="dProvider" creationComplete="init()"

            editable="true" itemEditBeginning="checkIfAllowed(event)" itemEditEnd="onEditEnd(event)"

            selectionMode="multipleCells" itemRenderer="renderer.ColorForDashBoard" contextMenu="{cMenu}"/ >