tags:

views:

201

answers:

1

Why is it that, when I enable dragging-and-dropping in a TitleGrid, items are copied when they are dragged instead of moved?

For example:

<mx:TileList dragEnabled="true" dropEnabled="true">
    <mx:dataProvider>
        <mx:Array>
            <mx:Object label="Nokia 6630"/>
            <mx:Object label="Nokia 6680"/>
        </mx:Array>
    </mx:dataProvider>
</mx:TileList>

When either of those items is clicked-and-dragged, it will get copied instead of moved.

This is especially confusing because TileList is a decedent of ListBase, which DataGrid also descends from... But DataGrid does the right thing when dragging and dropping items.

+1  A: 

Hi, please test following code:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"&gt;

 <mx:TileList dragEnabled="true" dragMoveEnabled="true" dropEnabled="true">
  <mx:dataProvider>
   <mx:Array>
    <mx:Object label="Nokia 6630"/>
    <mx:Object label="Nokia 6680"/>
   </mx:Array>
  </mx:dataProvider>
 </mx:TileList>

 <mx:TileList dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" />

</mx:WindowedApplication>

The solution of your problem is dragMoveEnabled="true". Hope that helps.

radekg
Hurra! It works! Thanks a lot. I don't know how I missed "dragMoveEnabled"...
David Wolever