1 Reply Latest reply on Dec 1, 2009 1:09 AM by paul.williams

    Drag'n'Drop from DataGrid to AdvancedDataGrid

    hushcoder77

      Hi !

       

      I've been searching and searchig for this on the web and i couldn't found yet a solution !

      I need to drag from an item from a DataGrid control to an AdvancedDataGrid control.

       

      I have the flags dragEnabled=true in DataGrid and dropEnabled=true in the AdvancedDataGrid.

       

      Even cathching the event DragEnter in AdvancedDatagrid, and then giving:

      DragManager.acceptDrop(advGrid)

      i cannot drop the item ! the event DragDrop doesn't fire at all !

       

      Can you please help on this ?

       

      Thanx

        • 1. Re: Drag'n'Drop from DataGrid to AdvancedDataGrid
          paul.williams Level 4

          The below works for me:

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application
          xmlns:mx="http://www.adobe.com/2006/mxml"
          layout="vertical">

              <mx:XMLList id="employees">
                  <employee>
                      <name>Christina Coenraets</name>
                      <phone>555-219-2270</phone>
                      <email>ccoenraets@fictitious.com</email>
                      <active>true</active>
                  </employee>
                  <employee>
                      <name>Joanne Wall</name>
                      <phone>555-219-2012</phone>
                      <email>jwall@fictitious.com</email>
                      <active>true</active>
                  </employee>
                  <employee>
                      <name>Maurice Smith</name>
                      <phone>555-219-2012</phone>
                      <email>maurice@fictitious.com</email>
                      <active>false</active>
                  </employee>
                  <employee>
                      <name>Mary Jones</name>
                      <phone>555-219-2000</phone>
                      <email>mjones@fictitious.com</email>
                      <active>true</active>
                  </employee>
              </mx:XMLList>

              <mx:DataGrid
               id="dg"
               width="500"
               rowCount="5"
               dataProvider="{employees}"
               dragEnabled="true">
                  <mx:columns>
                      <mx:DataGridColumn dataField="name" headerText="Name"/>
                      <mx:DataGridColumn dataField="phone" headerText="Phone"/>
                      <mx:DataGridColumn dataField="email" headerText="Email"/>
                  </mx:columns>
              </mx:DataGrid>
             
              <mx:AdvancedDataGrid
               id="adg"
               width="500"
               rowCount="5"
               dropEnabled="true">
               <mx:columns>
                      <mx:AdvancedDataGridColumn dataField="name" headerText="Name"/>
                      <mx:AdvancedDataGridColumn dataField="phone" headerText="Phone"/>
                      <mx:AdvancedDataGridColumn dataField="email" headerText="Email"/>
                  </mx:columns>
              </mx:AdvancedDataGrid>

          </mx:Application>