I haven't actually done this, but I was thinking... have you tried
calling preventDefault() as it sayz in the documentation for
dropEnabled property on ListaBase:

"If you set this property to true, the control accepts all data
formats, and assumes that the dragged data matches the format of the
data in the data provider. If you want to explicitly check the data
format of the data being dragged, you must handle one or more of the
drag events, such as dragOver, and call the DragEvent's
preventDefault() method to customize the way the list class accepts
dropped data."

http://livedocs.macromedia.com/flex/2/langref/mx/controls/listClasses/ListBase.html#dropEnabled

I'd try twiddling the 'dropEnabled' property, and calling
preventDefault()...

Let us know if this works.

Thunder

--- In flexcoders@yahoogroups.com, "sufibaba" <[EMAIL PROTECTED]> wrote:
>
> To Those who might be interested in a possible bug.
> 
> Has anyone successfully been able to drag from a Tree to a Datagrid?
> 
> I tried various approaches.. also writing DND methods.  The trace is
> showing that the dragSource is indeed 'treeItems' and the dropedTarget
> is the datagrid, however, I still get the Red X.  Is this a bug or am
> I missing something. 
> 
> Help is super greatly appreciated.
> 
> -- Tim
> 
> -----------  Code Sample: ----------------------------------------
> private var dropedTarget:UIComponent;
> private function doGridDragEnter(event:DragEvent):void {
>             // Get the drop target component from the event object.
> 
>             //var dropTarget:Canvas=Canvas(event.currentTarget);
>             dropedTarget = UIComponent(event.currentTarget);    
>           trace("doTreeDragEnter= " + event.currentTarget);
>             // Accept the drag only if the user is dragging data 
> 
>             if (event.dragSource.hasFormat('treeItems')) {
>               trace("hasFormat= " + event.dragSource.formats);
>               trace("dropedTarget= " + dropedTarget);
>                 DragManager.acceptDragDrop(dropedTarget);
>             }
>         }
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to